Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

OOP/Smarty design suggestions

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
l810c
Smarty Rookie


Joined: 04 Feb 2006
Posts: 6

PostPosted: Sat Feb 04, 2006 4:46 am    Post subject: OOP/Smarty design suggestions Reply with quote

I'm an intermediate PHP developer and have just recently started with OOP and brand new at Smarty.

I'm developing a house rental application.
Say I have 3 tables:
landlords
renters
properties

I jumped right in and was fairly quickly able to modify the Guestbook application to Landlords. Added a delete function and now have a nice backend maintenace page for landlords.

I was thinking that I would create completely separate classes for renters and properties, but then I started getting a bit confused.

All of the information in the guestbook_setup.php(no landlord_setup.php) would be redundant.

Should I have a master RENTAL class and access all the tables from it? Or should I setup classes for each table?

This is where all simple tutorials I have found are lacking. I need a simple multi-table application framework.

Any suggestions would be great. Code examples or links would be excellent.
Back to top
View user's profile Send private message
demental
Smarty Rookie


Joined: 11 Jan 2006
Posts: 20
Location: Lost in the French deeeeep countryside

PostPosted: Sat Feb 04, 2006 9:59 am    Post subject: Reply with quote

Your description is quite vague, anyway I would advise you to make kind of an abstract class to handle common tasks, then make two subclasses for each guestbook. If you want some efficient database handling I suggest you to have a look at the killer PEAR extension DB_DataObject.
http://pear.php.net/package/DB_DataObject

And some ways to use Smarty and PEAR extensions together here :
http://demental.info/blog/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP