where to define domain objects

7 views
Skip to first unread message

Denis

unread,
Jun 11, 2010, 4:45:58 PM6/11/10
to Google Web Toolkit
Hello,

I am new to use GWT RPC.
I am going to define a domain object which will map to a database
table and be transported all across the layers from the data
persistence to business logics and finally GWT presentation layer.

The question is where should I define those domain objects? Inside the
existing client/server/shared folders or add a new domain folder?

Thanks.
Denis

Sky

unread,
Jun 12, 2010, 2:53:03 PM6/12/10
to Google Web Toolkit
Hi Denis.

I'm not going to be of much help, but I am curious and want to
understand what a "Domain Object" is. Is this supposed to be
essentially a global object for the web app that is not user dependent
but all layers need access to it's methods/members? TBH I haven't used
GWT for a fully layered web app, just for front end presentation with
just a tiny bit of basic GWT RPC (super simple, super easy) so I
haven't even dealt with objects that are shared across the server and
client but I've read other posts about them and it sounds powerful. I
look forward to using shared objects in my next project most likely.
So I'm just gonna guess your domain object should go in the shared
folder, maybe?

Regardless, gl with it all

Stefan Bachert

unread,
Jun 13, 2010, 11:08:49 AM6/13/10
to Google Web Toolkit
Hi Denis,

It is absolutely clear where domain object are NOT located, in client
and shared. Domain objects have nothing to do in GUI or client

for a very simple project I would put it under server.
But in general I would put domain objects into a separate project.
The reason is, in general there is more than one application possible
dealing the same domain objects.

In general you have the following kind of objects on the server side
which may build an own layer and thatfore projects.

Session objects (state of your gui, application dependant, may be
persistent)

Application objects (application dependant, persistant)

Domain objects (application independant, persistant)


Stefan Bachert
http://gwtworld.de

Denis

unread,
Jun 15, 2010, 11:05:28 AM6/15/10
to Google Web Toolkit
The domain object I mentioned needs some further clarification:
It's a serializable Data Transfer Object/Bean/POJO that will be
transferred across all layers: presentation, business, and
persistence.

With this in mind, I put the domain package under \client following
the approach described in the book of 'Pro Web 2.0 Application
Development with GWT'

On Jun 13, 11:08 am, Stefan Bachert <stefanbach...@yahoo.de> wrote:
> HiDenis,
>
> It is absolutely clear where domain object are NOT located, in client
> and shared. Domain objects have nothing to do in GUI or client
>
> for a very simple project I would put it under server.
> But in general I would put domain objects into a separate project.
> The reason is, in general there is more than one application possible
> dealing the same domain objects.
>
> In general you have the following kind of objects on the server side
> which may build an own layer and thatfore projects.
>
> Session objects (state of your gui, application dependant, may be
> persistent)
>
> Application objects (application dependant, persistant)
>
> Domain objects (application independant, persistant)
>
> Stefan Bacherthttp://gwtworld.de

Joost Bloemsma

unread,
Jun 16, 2010, 4:48:27 AM6/16/10
to Google Web Toolkit
Actually, the shared package is introduced for stuff you use on both
the client and the server side. So that's the place to put your domain
objects (entity models or however you want to call them). The client
package will work fine too, since everything in the client package
will be (for now) compiled into bytecode and will be available on
server side. But I'm not sure if that's done for backward
compatibility and could be changed in the future.

So, I would recommend 'shared'.

Gr., Joost
Reply all
Reply to author
Forward
Message has been deleted
0 new messages