2008年7月24日星期四

Re: [fw-mvc] Best practices in a thin-controller application

Ultimately, everything will come down to some existential philosophy argument... :)

-Bryce

don@zampano.com wrote:
Well, maybe it first sounds like it ;-)  But more than that it is clear and coherent OOP design. The first step is to think what objects really are, why they exist, when  and how they are created, how and where they live and communicated with and how they are destroyed. This wasn't meanmt as a start for a somwhat esoteric or hyperabstract discussion. I swear! :-)  "Atheistic" example: Make yourself naked, you are still yourself.  You have identity  (at least for yourself and for your wife and children, hopefully...)  Wear some clothes. That's you with some attire (attributes).  Go to bed at home without attire, you are still yourself and that is *valid* behaviour.  Go naked to a restaurant, you are still yourself BUT have not a *valid* state and behaviour.    You->Naked->AtHome = valid You->Naked->EnterRestaurant = invalid  In the EnterRestaurantAction you are not a valid object. But you have undoubtly identity.  but  Factory->Create->Car->withEngine(4) and withEngine fails because there are no more left; well we have to wait until there will be some delivered.  Until then we have no car, just a thing made of metal and plastics. (not the best example ok - and depends on *your* definition what a car *is*)  It's that kind of easy. Just put it into software. (I know it isn't, reality is always much harder to model in software)  I would not use an non-existent object and make it persistent. That would be like saving nothing to nirvana ;-)    ========== Urspr. Mitteilung ========== Von: vtbludgeon@gmail.com An: fw-mvc@lists.zend.com Datum: Thu, 24 Jul 2008 16:17:52 +0200 Betreff: Re: [fw-mvc] Best practices in a thin-controller application  On Thu, Jul 24, 2008 at 9:52 AM, <don@zampano.com> wrote:    
 If you consider an object to be generated only in a (minimal) complete state, than the form of this is your decision and freedom. But you may not bruise this rule. If an object isn't of a form that reflects its clear identity , then it is simply not existent.      
 You know, this is starting to sound like some abstruse Buddhist treatise on the nature of Reality. Nagarjuna could not have put it better himself.  (-:   
August 1st is National Minority Organ Donor Awareness Day

没有评论: