On 7/10/2009 7:36 PM, Mert Oztekin wrote:
Seems ok.

Just a thought:

         Your model seems to be coded just for retreiving data. IMO you should 
code it for all possible actions(insert,update,delete,select). And also it 
should run without any database calls(you may create a new bank user in a page 
and use it than throw it away, so you wont have to need a database to save it).

         Your model may be more useable when it can holds the data 
itself(without retreiving it from db first), after that a save() method may 
inserts/updates it to db.



-----Original Message-----
From: Eric Bauman [mailto:baum...@livejournal.dk]
Sent: Wednesday, October 07, 2009 9:35 AM
To: php-general@lists.php.net
Subject: [PHP] Insult my code!

Hi there,

I'm in the process of trying to wrap my head around MVC, and as part of
that, I'm attempting to implement a super-tiny MVC framework.

I've created some mockups of how the framework might be used based
around a very simple 'bank', but I'm trying to get some feedback before
I go and implement it, to make sure I'm actually on the right track.

Any thoughts would be much appreciated!

Model - http://www.pastebin.cz/23595
Controller - http://www.pastebin.cz/23597
View - http://www.pastebin.cz/23598
Template - http://www.pastebin.cz/23599

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Bu mesaj ve ekleri, mesajda gönderildiği belirtilen kişi/kişilere özeldir ve 
gizlidir. Size yanlışlıkla ulaşmışsa lütfen gönderen kisiyi bilgilendiriniz ve 
mesajı sisteminizden siliniz. Mesaj ve eklerinin içeriği ile ilgili olarak 
şirketimizin herhangi bir hukuki sorumluluğu bulunmamaktadır. Şirketimiz 
mesajın ve bilgilerinin size değişikliğe uğrayarak veya geç ulaşmasından, 
bütünlüğünün ve gizliliğinin korunamamasından, virüs içermesinden ve bilgisayar 
sisteminize verebileceği herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.


Thanks for the response!

You suggested that the model should run without any database calls. Do you mean that they should not exist in a model (ie. a controller should instantiate /and/ populate a model), or rather that it should be optional (ie. each method only updates the state of the object, and load() & save() must be explicitly called to interact with the DB)?

Or am I way off track.

Cheers,
Eric

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to