Hi Mario On 5 April 2015 at 03:51, mbneto <[email protected]> wrote:
> Hi Marco, > > Thank you for the reply. As part of some applications I see the > following happening: > > 1st - Request > a) fetch data from persistence layer > b) map them to Objects > c) use some in the request itself > d) save some in a session layer > > 2nd - Request (part of the same application process - perhaps the submit > of the form) > a) restore the session data > b) update the Objects based on the form data > c) persist some of the objects back - updating the content > > While not all objects would have the Doctrine annotation, some may have, > even if I use them for read only purposes. > > Right now I can do it fine because they are POPO and I map them manually > when I first do the search. After this I can serialize/deserialize at will. > > Of course the idea is to use Doctrine to prevent me from having to do such > mapping manually - and to have all the extra features Doctrine provides. > > In this scenario what would be me course of action? > This is what most of us ended up with, but it's actually a mess to deal with, and that with or without ORM. The best approach, in my opinion, and especially with multi-step forms, is to have form-specific DTOs/ValueObjects that you can actually safely store in session data or in a transient storage location that you can reference somehow. This greatly simplifies the entire process, and is also much safer and reliable than just making complex forms interact with your persistence layer (which, honestly, is quite problematic in first place). Greets, Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
