When you run into a situation where one part of the system appears to be duplicating what another part of the system is doing it usually means that you have either not chosen the names for the methods/classes well, or you have not modelled the functionality well. In order to figure out where things are wrong I usually boil it down to 'what is the one thing that this component is suppposed to be doing'.
In your case it looks like you want the model to be responsible for the data access for the Users and the ManagerUsers component to figure out when to call each method in the model. I would normally call the data access component something like UserDAO and give it 4 starting methods called createUser(), updateUser(), deleteUser() and getUser(). Those methods may be renamed and added to later, but it's usually a safe place to start. The controller component would probably have a method called processUserForm() that would inspect the form scope and decide what methods needed to be called in the model to provide security checking, data validation, transfer object/bean creation etc. The controller is supposed to be deciding what happens in the application, so you ought to be delegating as much of the flow control logic as possible to it. That's why I would only have 1 entry method for the Users CRUD operations. That method would probably call some private methods such as validateUserForm() and checkPermission() which would do validation/security checking before calling the UserDAO component to do CRUD operations as appropriate. Having said that, exactly how the components and methods are designed is very specific to the application at hand, so don't take the above as the gospel on 'how to do it'. my 2 cents Spike -------------------------------------------- Stephen Milligan Code poet for hire http://www.spike.org.uk Do you cfeclipse? http://cfeclipse.tigris.org >-----Original Message----- >From: >[EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] o.uk] On Behalf Of Sam Clement >Sent: Monday, May 31, 2004 7:48 AM >To: [EMAIL PROTECTED] >Subject: [ cf-dev ] MVC > >I'm learning about the MVC methodology and looking for good >resources for beginners. I've found some good stuff from >Benoit Hediard (blogmx >code) but would like some more 'theory put into practice' type stuff. > >Currently I'm worried about not de-coupling my controllers >from the model layer enough. They basically seem to mirror each other: > >Controller: >ManagerUsers >add/edit/delete user > >Model: >Users >Add/edit/delete user (maybe add authenticate/islogged/isAdmin etc.) > >Is it wise to break up the model layer into smaller separate >cfcomponents or is it best to create larger cfcomponents that >encapsulate separate business processes? I guess the skill is >knowing which trade-offs are worth it (overly complex >components vs. simple de-coupled components but a more complex >architecture with more dependencies). > >Any help appreciated. > > _____ > >Sam Clement >ABOVE Studios >Boutique Design Solutions > >32 Clifford Street - Belmont >Trinidad + Tobago - West Indies >T: (868) 621 5159 W: abovestudios.com > > > > > > > >-- >These lists are syncronised with the CFDeveloper forum at >http://forum.cfdeveloper.co.uk/ >Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > >CFDeveloper Sponsors and contributors:- >*Hosting and support provided by CFMXhosting.co.uk* :: >*ActivePDF provided by activepdf.com* > *Forums provided by fusetalk.com* :: *ProWorkFlow >provided by proworkflow.com* > *Tutorials provided by helmguru.com* :: *Lists >hosted by gradwell.com* > >To unsubscribe, e-mail: [EMAIL PROTECTED] > -- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ CFDeveloper Sponsors and contributors:- *Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com* *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com* *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com* To unsubscribe, e-mail: [EMAIL PROTECTED]