-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Pattern - May i instantiate a Domain object in Presentation
PostPosted: Tue Sep 30, 2008 9:41 am 
Newbie

Joined: Mon Jun 09, 2008 1:08 pm
Posts: 3
I have a doubt, is anti-pattern instantiate a Domain Object in Presentation Layer and fill the object than pass to Service Layer?


Top
 Profile  
 
 Post subject: Re: Pattern - May i instantiate a Domain object in Presentat
PostPosted: Wed Oct 01, 2008 7:56 am 
Pro
Pro

Joined: Tue Jun 12, 2007 4:13 am
Posts: 209
Location: Berlin, Germany
bigtrip wrote:
I have a doubt, is anti-pattern instantiate a Domain Object in Presentation Layer and fill the object than pass to Service Layer?


It depends on your personal view, and of course of your architecture.

If you have a rich Java client it would be a wast of ressources if you were doubling all your domain objects into so called "value objects". Why should the client not directly operate on domain objects? If you have a rich client, it will also execute some business logic, and it would be a lie to say that the client is just a silly presentation layer.

With this in mind, it is really natural if the client is instantiating business objects on user request, and only if the user presses the save button, these objects will be sent to server were they will be persisted as entities.

The whole point of a discussion like this is: it is an anti-pattern if you are doubling business logic regarding client and server classes, so that you they might differ.

_________________
Carlo
-----------------------------------------------------------
please don't forget to rate if this post helped you


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.