I think that in symfony, the DAO classes that you are referring to are right by the models:
ahonne...@dev1:~/repos/sv_ng$ ll lib/model/doctrine/ FeaturedSearch* -rw-r--r-- 1 ahonnecke ahonnecke 302 Jan 9 18:42 lib/model/doctrine/ FeaturedSearch.class.php -rw-r--r-- 1 ahonnecke ahonnecke 60 Jan 9 18:42 lib/model/doctrine/ FeaturedSearchTable.class.php FeaturedSearch is an implementation of the "Row Data Gateway"/"Active Record" pattern : FeaturedSearchTable is an implementation of the "Table Data Gateway"/"Data Access Object" pattern: So put all your SQL/DQL in use that *Table class. Personally, If I have enough code that I feel like the controller is getting full, I know then that I am writing it wrong, and I need to create some library classes that encapsulate some of the functionality that is in the controller (or the Table, but I rarely feel like that is getting overfull) SO: Model = /lib/model/doctrine/FeaturedSearch.class.php DAO = /lib/model/doctrine/FeaturesSearchTable.class.php App = /app/frontend/lib/appWideLogin.class.php... Controllers = actions/actions.php Templates = templates/<*>Success.php ashton On Feb 1, 6:46 am, Tom Ptacnik <[email protected]> wrote: > Hi, > > I want to ask you where you put complex application code when > developing with symfony (some bigger applications). > > When I don't develope with symfony faramework I've got this tiers: > > - Model classes (only beans - attributes and getters setters, this > class doesn't do anything by itself) > - DAO classes - store Models into database, creating models from > database ( add(), edit(), delete(), list(), ....) > - Application classes - application code - the logic of the > application which isn't suitable (too big/complicated, or wanted to be > reused) for controllers > - what to do when deleting object (e.g. I want to send an email > before, and delete two images), adding objects... > - application of user restrictions while accesing to the objects - > using DAO classes for accesing into database > - many methods names are same as those in DAO classes - insert(), > edit(), delete()..., but many of them do much more logic before > calling methods from DAO class > - Controllers - they create an application logic - call the methods of > the Application classes and send some objects and variables into > teplates (controllers call only Application classes, never DAO classes > directly) > - Templates (classic templates) > > So it's: Templates - Controllers - Application classes - DAO , and > this all tiers use a Model objects > > In symfony it's: Templates - Controllers - Model(objects and table > classes) > > If I have a simple application it's ok to put all app code into the > Models, but if I want to create a little bigger application I'm afraid > of "too fat Models" ... > > Where do you store more complicated application logic? Do you have it > all in the Models? -- You received this message because you are subscribed to the Google Groups "symfony users" group. 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/symfony-users?hl=en.
