On Sat, 06 Sep 2008, FakeBoy wrote: > But now I am programming web application in which all these 3 layers will be > placed in the same Virtual machine. So now It seems to be pointless to > convert/copy business obejct to DTO and back. So I would like to use > business objects directly in client layer. Middle layer will be still in my > app, but all service method will be return business objects directly instead > of DTO.
Yep, nowadays Fowler's First Law of Distributed Object Design http://www.ddj.com/showArticle.jhtml?articleID=184414966 is widely acknowledged :) DTO structs are often redundant clutter and it makes more sense to put domain logic to domain objects than in a separate "tier". > Now I am thinking abou problems that I will face to. > 1. Some business object are not serializable - I tried to made some simple > examples (ListPage, FormPage), and some little problem I overcome, but I > must made my custom Model => TransientModel, PropertyModel => > TransientPropertyModel etc. Well, if your business objects (domain objects?) cannot be made serializable, it's not possible to store them directly in the HTTP session, so they must be stored elsewhere. One standard Wicket way to achieve this is to use a detaching model, such as LoadableDetachableModel . http://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-DetachableModels Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations Oy <URL: http://www.ri.fi/ > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
