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

Refactoring #28

Merged
merged 6 commits into from
Nov 29, 2017
Merged

Refactoring #28

merged 6 commits into from
Nov 29, 2017

Conversation

leogr
Copy link
Collaborator

@leogr leogr commented Nov 28, 2017

This PR aims to fix #9 and #10.
Also, it makes the naming convention more clear and closer to Golang one.

Eg, now you can use datatype.New() instead of core.NewDataType()

Notice that, I've not promoted schemas/attribute to package because IMHO it's not needed.

Maybe, I will add just few commits trying to remove a bit of code dup (eg. AttrNameExpr).
However, review it ASAP because it's blocking, please.

@leogr leogr self-assigned this Nov 28, 2017
@leogr leogr requested review from leodido and alelb November 28, 2017 17:02

// ResourceTyper is the interface implemented by types that can hold Common resource attribute and are can return it ResourceType
type ResourceTyper interface {
ResourceType() *ResourceType
GetCommon() *Common
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply Common() ?

Do you mean if I refactor ?

Copy link
Collaborator Author

@leogr leogr Nov 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use Common() because its name will collide with Common struct member.
For the same reason we have GetSchema() instead of Schema()

:(

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right ... Hmmm :\

I propose to rename Common struct field into CommonAttributes or something similar.
And then rename GetCommon() to simply Common().

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, so I'm going to fix right now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done bf4e508 !

@leogr leogr merged commit dacde73 into develop Nov 29, 2017
@leogr leogr deleted the feature/refactoring branch November 29, 2017 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource Interface
3 participants