[
https://issues.apache.org/jira/browse/OFBIZ-3774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868470#action_12868470
]
Marc Morin commented on OFBIZ-3774:
-----------------------------------
We did a similar visitor pattern to the entire presentment (Screen, Form, Menu)
space and the controller. This path, mainly separation of concern, is very
powerful, and allows easy extension to the system.
The typical implementation path that has been taken, is to develop a series of
abstract visitors that have a few base behaviors, navigation of the components,
and throwing exceptions for each component. This enables a specific visitors
to extend the base navigation class, to get full model navigation and add any
specific behavior with a surprisingly small amount of code.
We've done "Presentment" visitors for walking, validation (examining
location/name references looking for dangling screen/from/controller
references, etc.. used in junit test cases - fail build if broken links),
security auto-notation (propagates service security declarations, to screens
model objects, and will automatically remove buttons, links to areas in the
application that the user doesn't have rights to access.) We have a partial
dump (pretty-print) for the PresentmentModel as well.
Externalizing the creation of the model objects, is crucial to getting the full
power of this type of change. The model objects should have nothing but their
attributes with their getter/setter methods (and the accept).
> Add The Visitor Pattern To Screen Widget Model Classes
> ------------------------------------------------------
>
> Key: OFBIZ-3774
> URL: https://issues.apache.org/jira/browse/OFBIZ-3774
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Reporter: Adrian Crum
> Priority: Minor
> Attachments: OFBIZ-3774.patch
>
>
> From time to time there has been interest expressed in introducing the
> visitor pattern to the screen widget model classes. This issue is intended to
> provide a forum on the subject and a means to vote on it. Details are in the
> comments.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.