Introduce a ModelEntityReaderBuilder to decouple ModelEntity and ModelReader
---------------------------------------------------------------------------- Key: OFBIZ-3959 URL: https://issues.apache.org/jira/browse/OFBIZ-3959 Project: OFBiz Issue Type: Improvement Components: framework Reporter: chris snow ModelEntity is quite tightly coupled to ModelReader. I'm assuming ModelEntity is primarily responsible for representing a model of an entity, however, it is also mixed with logic for building itself from the xml definition. For me it seems like the build logic should be moved to another class, e.g. ModelEntityReaderBuilder that is responsible for building the ModelEntity from the ModelReader? See: http://ofbiz.135035.n4.nabble.com/entity-engine-separation-of-concerns-td2715929.html#a2715929 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-3959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-3959: ------------------------------- Priority: Minor (was: Major) > Introduce a ModelEntityReaderBuilder to decouple ModelEntity and ModelReader > ---------------------------------------------------------------------------- > > Key: OFBIZ-3959 > URL: https://issues.apache.org/jira/browse/OFBIZ-3959 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: chris snow > Priority: Minor > > ModelEntity is quite tightly coupled to ModelReader. I'm assuming ModelEntity is primarily responsible for representing a model of an entity, however, it is also mixed with logic for building itself from the xml definition. For me it seems like the build logic should be moved to another class, e.g. ModelEntityReaderBuilder that is responsible for building the ModelEntity from the ModelReader? > See: http://ofbiz.135035.n4.nabble.com/entity-engine-separation-of-concerns-td2715929.html#a2715929 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915436#action_12915436 ] Adrian Crum commented on OFBIZ-3959: ------------------------------------ If anyone is interested in contributing to this effort, I can create a branch for it. Another thing that could be done (outside the scope of this issue but worth mentioning) would be to convert models to the visitor pattern, and move all behaviors to visitors. That change - coupled with the builder change - would result in models that are nothing more than data structures. > Introduce a ModelEntityReaderBuilder to decouple ModelEntity and ModelReader > ---------------------------------------------------------------------------- > > Key: OFBIZ-3959 > URL: https://issues.apache.org/jira/browse/OFBIZ-3959 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: chris snow > Priority: Minor > > ModelEntity is quite tightly coupled to ModelReader. I'm assuming ModelEntity is primarily responsible for representing a model of an entity, however, it is also mixed with logic for building itself from the xml definition. For me it seems like the build logic should be moved to another class, e.g. ModelEntityReaderBuilder that is responsible for building the ModelEntity from the ModelReader? > See: http://ofbiz.135035.n4.nabble.com/entity-engine-separation-of-concerns-td2715929.html#a2715929 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915466#action_12915466 ] chris snow commented on OFBIZ-3959: ----------------------------------- Hi Adrian - will non-contributors be able to commit to the branch? If not, it would probably be easier for me to use github. I'm not sure how far I will get and how quick I will move - the current coupling between EntityModel and EntityReader make it quite difficult to work out what the entity engine is actually doing. > Introduce a ModelEntityReaderBuilder to decouple ModelEntity and ModelReader > ---------------------------------------------------------------------------- > > Key: OFBIZ-3959 > URL: https://issues.apache.org/jira/browse/OFBIZ-3959 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: chris snow > Priority: Minor > > ModelEntity is quite tightly coupled to ModelReader. I'm assuming ModelEntity is primarily responsible for representing a model of an entity, however, it is also mixed with logic for building itself from the xml definition. For me it seems like the build logic should be moved to another class, e.g. ModelEntityReaderBuilder that is responsible for building the ModelEntity from the ModelReader? > See: http://ofbiz.135035.n4.nabble.com/entity-engine-separation-of-concerns-td2715929.html#a2715929 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915470#action_12915470 ] Adrian Crum commented on OFBIZ-3959: ------------------------------------ Chris, Only committers can commit to the branch. The concept would be to rally support for the idea and get others to help by contributing patches to this issue. The patches are applied to the branch. If all goes well, eventually the branch will be merged back to the trunk. The same process is being followed currently in the JQuery branch. > Introduce a ModelEntityReaderBuilder to decouple ModelEntity and ModelReader > ---------------------------------------------------------------------------- > > Key: OFBIZ-3959 > URL: https://issues.apache.org/jira/browse/OFBIZ-3959 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: chris snow > Priority: Minor > > ModelEntity is quite tightly coupled to ModelReader. I'm assuming ModelEntity is primarily responsible for representing a model of an entity, however, it is also mixed with logic for building itself from the xml definition. For me it seems like the build logic should be moved to another class, e.g. ModelEntityReaderBuilder that is responsible for building the ModelEntity from the ModelReader? > See: http://ofbiz.135035.n4.nabble.com/entity-engine-separation-of-concerns-td2715929.html#a2715929 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915533#action_12915533 ] chris snow commented on OFBIZ-3959: ----------------------------------- Hi Adrian, to help me understand the visitor solution, do you have an example of how the visitor pattern could be applied in EntityModel? > Introduce a ModelEntityReaderBuilder to decouple ModelEntity and ModelReader > ---------------------------------------------------------------------------- > > Key: OFBIZ-3959 > URL: https://issues.apache.org/jira/browse/OFBIZ-3959 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: chris snow > Priority: Minor > > ModelEntity is quite tightly coupled to ModelReader. I'm assuming ModelEntity is primarily responsible for representing a model of an entity, however, it is also mixed with logic for building itself from the xml definition. For me it seems like the build logic should be moved to another class, e.g. ModelEntityReaderBuilder that is responsible for building the ModelEntity from the ModelReader? > See: http://ofbiz.135035.n4.nabble.com/entity-engine-separation-of-concerns-td2715929.html#a2715929 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915539#action_12915539 ] Adrian Crum commented on OFBIZ-3959: ------------------------------------ I don't have an example. Just imagine a model class whose only methods are a constructor, an accept method, and accessor methods. That shouldn't affect the builder pattern, so I wouldn't worry too much about it. > Introduce a ModelEntityReaderBuilder to decouple ModelEntity and ModelReader > ---------------------------------------------------------------------------- > > Key: OFBIZ-3959 > URL: https://issues.apache.org/jira/browse/OFBIZ-3959 > Project: OFBiz > Issue Type: Improvement > Components: framework > Reporter: chris snow > Priority: Minor > > ModelEntity is quite tightly coupled to ModelReader. I'm assuming ModelEntity is primarily responsible for representing a model of an entity, however, it is also mixed with logic for building itself from the xml definition. For me it seems like the build logic should be moved to another class, e.g. ModelEntityReaderBuilder that is responsible for building the ModelEntity from the ModelReader? > See: http://ofbiz.135035.n4.nabble.com/entity-engine-separation-of-concerns-td2715929.html#a2715929 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |