I ran across a blog discussion today about best practices regarding locations of mach-ii listeners -vs- model code.
A summary.
Listeners are not part of your model layer, so keep them separate from the model code.
Put listeners into a /listeners folder.
Put model code in a /model folder.
In the model layer, some suggested organizing the cfcs like this:
/model/Beans
/model/Services
/model/DOA
/model/Gateway
This is know as grouping by functionality.
Most of the expert opinion (Matt Woodward, Peter Farrell) favored this approach for the model layer.
/model/busObject/
where the bean, service, DAO and Gateway objects were grouped by type. Since these objects comprise the abstract concept of a package, store them as a package. This seems more intuitive, as other programmers come into the application, they will take the approach of what bus objects are there and see what pieces of that package exist.
This is a quote from P Farrell "Otherwise, you are breaking objects into
directories based on object type (pattern/functionality of the object)
instead of the object's purpose (having to do with "user" stuff). This
is counter-intuitive as a developer would have to scan through a
"beans", "gateways", "services" and "daos" directories to see if the
User (bean) has a corresponding service, dao, gateway, etc.. Much
easier (and it makes more sense in the long run) to group by object
group instead of object type (pattern/function). "
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment