Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename struct OpenControl to Workspace/ LocalWorkspace #202

Closed
2 tasks done
jcscottiii opened this issue Jul 22, 2016 · 1 comment
Closed
2 tasks done

rename struct OpenControl to Workspace/ LocalWorkspace #202

jcscottiii opened this issue Jul 22, 2016 · 1 comment

Comments

@jcscottiii
Copy link
Member

jcscottiii commented Jul 22, 2016

In order to make more sense of the structs and their names and function, we should rename OpenControl to Workspace / LocalWorkspace.

To the external user of the go code, if they import the code. It's not obvious what OpenControl means. Also, right now it represents the in-memory data for all the collected resources via the get command which essentially creates a workspace.

And rename things like NewOpenControl to NewWorkspace

That interface will have methods like:

// not the exact code interface but just a rough idea
type Workspace interface {
   GetComponents() Components // return the interface of Components which needs to be done.
   GetCertifications() Certifications // return the interface of Certifications which needs to be done.
  ... // and so on
}

So... Why have an interface and struct? It makes it easier for external projects to use the interface in tests. Instead of 1) having to load same fixture data from this repo in their project or 2) having to import all the concrete structs and their different versions (e.g. different component.yaml versions), they can just use the interface and mock it with https://godoc.org/github.com/stretchr/testify/mock

@jcscottiii jcscottiii changed the title rename struct OpenControl to Workspace rename struct OpenControl to Workspace Jul 22, 2016
@jcscottiii jcscottiii changed the title rename struct OpenControl to Workspace rename struct OpenControl to Workspace/ LocalWorkspace Jul 22, 2016
@afeld afeld added the HighBar label Jul 26, 2016
@jcscottiii
Copy link
Member Author

Closed by #226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants