Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-08-2008, 09:38 AM
Junior Member
 
Join Date: Jul 2008
Posts: 4
Default Where to store classes? Model?

Hi,

Im currently in the early stages of setting up a zf based site. I want to put out a question about where to store different classes. I have object classes (eg a user class with getters and setters), I have factory classes for instantiating the object classes and I have database classes for accessing the database.

What Im wondering is where to save these files? Do they all belong in the models folder, or do just the database classes belong there? I also have a library folder containing the zend framework and my own personal library for the project. Do the object classes and factorys belong in the library folder too?

Thanks for the direction
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-16-2008, 04:58 AM
Senior Member
 
Join Date: Jun 2008
Location: Florida
Posts: 108
Default

I personally try to reserve the library for code that is generic enough to work for any module. Inside my models directories are mostly classes that extend Zend_Db_Table_Abstract, or my custom version thereof. I think the models directories are also appropriate places to put classes that help facilitate communication between controllers, but still specific to that particular module.

Most of the above assumes you use the traditional modular layout...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:33 AM.