Yes, it would. So I might suggest a Factory class to generate the new
object. Where the factory sets initial values etc on a new object, and
returns a new object in a consistent state to the calling client
code.

(FYI: See Eric Evans, Domain Driven Design for more)



On Aug 7, 4:11 pm, "Jorge Vargas" <[EMAIL PROTECTED]> wrote:
> On Tue, Aug 5, 2008 at 9:41 PM, Nick Retallack <[EMAIL PROTECTED]> wrote:
>
> > I recall the docs at one point mentioning the usefulness of overriding
> > __init__ to aid in constructing new model records.  However, I just
> > noticed that __init__ runs even when you /get/ a model record from the
> > database.  What is a way to just alter the behavior of creating a new
> > record, but not touch records that already exist?
>
> that will go against OOP, why you will have two classes that
> "construct" differently? if you need to execute some code just ones,
> then do it on your "create" handler. maybe if you provide a valid
> usecase for this something could be worked out.
>
> > Currently I've
> > resorted to alternative methods (make_thing(args) instead of
> > Thing(args) to do the proper setup).

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to