Re: What design patterns do you usually use?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 4:36 PM +0100 2/29/08, Zoltán Németh wrote:
sure, all information belonging to an object is usually in a record of a
db.
but, you mean include('user_functions.php') automatically loads that
data? based on what? a global $user_id variable? if so, I would consider
that poor design...

Whoa there, you don't know what it's doing -- so saying poor design is probably not a good call.

 > And thus, two lines instead of three.

 But in fairness, the user_functions.php would
 establish a connection to the database and the
 function "set_user_name($user, 'tedd')" would
 simply use 'tedd' with respect to whatever
 "$user" is.

hmm that means you use only one user's info in the script. that's very
limiting.

Again, you don't know what's being called.

No reason to be insulting. What I am calling could be a pointer or an id to a record -- BOTH -- of which are no more limited than calling a class. What do you think languages are doing when they call segments of memory for data or function -- you think they pass ton's of variables or just a pointer? So, there's nothing limited here about what I'm doing. Think about it.

sure you can duplicate with procedural code anything my tons of classes
do... but above a certain project size it can easily become a
maintenance nightmare and an integration nightmare if there are more
than one developers. classes enforce some strict rules to everyone in
the team, so teamwork is much more efficient and the resulting codebase
is cleaner. I know from experience, as this project with the 400K lines
is a rewrite of the previous procedural version, which was developed and
maintained by a dozen of developers over the years, and it became such a
mess that none of us wants to touch it anymore...

Again -- the difference here is organizational style. Everything you can do in your classes I can do in my functions. Plus, you can have just the same amount of screw-ups as I can when you introduce more than one programmer and his style into the mix.

I don't like the tone here -- it appears that because I'm not agreeing with you that my code is limited or of poor design -- because let me assure you it's not!

So, let's just drop this -- you have your way and I have mine.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux