This is my preferred approach as well. Listeners are not part of the model -- they are part of the controller layer and therefore shouldn't really be mixed into with your model. More info on framework extensions here:
http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/wiki/FAQWhereShouldFrameworkExtensionsLive I prefer this format because you're grouping by purpose (User, Orders, etc.) instead of functional usage (beans, services, daos). I prefer by purpose because it's it more like building packages. Grouping by purpose is more probably inline with the way Java programmers do it. Not saying Java is the right way here, but CFML tends to barrow from Java a bit. Also, say you have an User and UserPrefs domain objects, I don't give them each there own directories and service objects. /User User.cfc UserPrefs.cfc UserService.cfc UserGateway.cfc etc. You probably won't use UserPrefs without a User because of the relationship. This also saves on redundant directories and service objects. Best, .pjf Eric Cobb said the following on 09/29/2009 03:34 PM: > I follow the same grouping style as Matt. Usually, I'll have all of my > listeners in a "listeners" directory, then everything else will be in: > > model/users > -user > -userGateway > -userDAO > -userService > model/products > -product > -productsGateway > ...ect... > > Thanks, > > Eric Cobb > http://www.cfgears.com > > > > Matt Williams wrote: > >> I prefer to group similar services, daos, gateways, and beans in one >> folder together (i.e., a Users folder, a products folder) for the >> simple reason that when I am building and/or changing something I am >> likely to open each of those related files at least to look and see >> what is going on. The more of them that are in the same folder, the >> easier they are to get to. This way I don't have to navigate to the >> beans folder, then the service folder, then the dao folder, .... you >> get the idea. >> >> The exception has been listeners. I've kept them separate probably >> because of habit more than anything. I guess they are more of a >> controller thing than a model thing, so I tend to not put them into >> the models directory, which is the parent directory to the various >> functions (users, products, etc.). >> >> -Matt Williams >> >> On Sep 29, 3:47 pm, MercuryNewt <[email protected]> wrote: >> >> >>> I'm getting ready to create some development standards for my client >>> with regards to ColdFusion and Mach-II. To put some context around >>> this effort, I've been working with ColdFusion for over 13 years, but >>> mainly inside of my own framework. Most of my work has been within >>> corporate environments where the concern over organization and >>> compliance with such was the most important aspect of development. >>> Now I'm with a client who does not have a lot of ColdFusion expertise >>> and they are primarily a Java OO shop. Mach-II works well as our OO/ >>> MVC framework, but we recently hired a new developer and his style and >>> mine are quite different. Although we both agree in form, e.g. using >>> a service layer, DAOs, etc. and not placing a lot of business logic >>> within our extended Mach-II componets, we almost seem to be on >>> opposite sides with how our business objects should be organized. In >>> case I'm confusing anyone, I'm referring to the directory structure >>> and how the various code artifacts of our Mach-II framework >>> applications are organized. I prefer to organize code based upon its >>> function and so beans exist in a "beans" directory at the root of my >>> application, the same goes for listeners, filters, plugins, views, >>> DAOs, services, etc. However, I'm curious to see what others are >>> doing with Mach-II apps and code organization. How do you organize >>> your code? >>> >>> >>> >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to Mach-II for CFML list. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/ Wiki / Documentation / Tickets: http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/ -~----------~----~----~----~------~----~------~--~---
