-
Notifications
You must be signed in to change notification settings - Fork 207
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
JsonLD #1645
JsonLD #1645
Conversation
core/web/jsonld/Organization.php
Outdated
{ | ||
use OrganizationTrait; | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please move the private vars into the OrganizationTrait?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure :)
@JohnnyMcWeed The unit tests seems to fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! We are very close to the final decisions. Why have you moved the fields() into the Trait? What was the idea behind?
core/web/jsonld/PersonInterface.php
Outdated
/** | ||
* Return the fields | ||
*/ | ||
public function fields(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JohnnyMcWeed fields should not be part of the interface i assume. It should be an abstract method of BaseThing instead.
trait PersonTrait | ||
{ | ||
use ThingTrait { | ||
fields as thingFields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as field() should not be part of the trait or interface, fields are applied in the object itself this allows us not to rename trait methods, which would lead into not clear design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be easier to maintain like that, cause we can avoid the "no single inheritance"-problem...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g.
In LocalBusinessTrait we'll merge in PlaceTrait->fields() and OrganisationTrait->fields()
Like this we always have only one place where the code belongs to, so if once schema get's changed or so, there's only one trait we have to do something and not fields everywhere we have to think about...
That was my idea behind it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, its right it could be more easy to maintain the fields. Maybe we could also find getter methods in BaseThing and auto build the fields. This would
- fixed the problem with renaming
- easy to maintain.
As every jsonld element MUST implement BaseThing.
WIP #1551