[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.emf] Re: Design question

Frank,

Thanks for the info - the Resource stuff will help me out in other aspects
of the application.  However, let me rephrase my last post.  My objects in
pkg B read "driver" information from a database (metadata so to speak). 
This driver information is interpereted in order to dynamically build
various configurations of objects in pkg A.  The objects in pkg A
themselves are not being persisted at all (neither are objects in pkg B
for that matter).  After reading some of the info on the Resource stuff -
I think I am ok modeling both packages as an EMF model since I am not
actually persisting the objects themselves, but rather reading dynamic
data that they will work with.

Frank Budinsky wrote:

> Brian,

> It sounds like pkg B would best be implemented as a Resource. It doesn't
sound
> like it's a model itself - it's just the code to persist the pkg A model.

> Unfortunately there isn't a tutorial, or much documentation on how to work
with
> resources. (The EMF book at http://www.awprofessional.com/titles/0131425420
> describes these things quite well, but you pay for it.) You can look at the
code
> in plugin org.eclipse.emf.ecore.xmi to see the default resource
implementations.
> You would replace the default implementation with a resource class of your
own
> which will do essentially what your pkg B is doing now.

> Frank.


> Brian Berry wrote:

> > I have a package (pkg A) which is used to represent my presentation layer
> > data, ie - simple data structures containing get/set attributes required
> > to paint the UI for my application.  I have another package (pkg B) of
> > utility classes that read from a database certain properties in order to
> > construct the objects of the type mentioned in pkg A.  Currently I have
> > both pkg A and pkg B generated as an EMF model.  Should I not make an EMF
> > model out of pkg B?  If I should proceed with implementing pkg B as a
> > Resource as mentioned in the last reply to my original post, is there a
> > tutorial or some documentation available on doing that?
> >
> > Frank Budinsky wrote:
> >
> > > Brian,
> >
> > > Without more specifics, its hard to answer this question. Generally,
> > > persistence (data access) would be implemented in a Resource, which is
not
> > > modeled in EMF.
> >
> > > Frank.
> >
> > > Brian Berry wrote:
> >
> > > > I have some packages in my application that are to be used for database
> > > > access of various objects.  Is it recommended to keep the EMF portion
of
> > > > my design limited to the simpler data structures as they are be auto
> > > > generated or will I benefit from implementing all of my packages as an
EMF
> > > > model and then writing the database access code in the impl package of
> > > > generated classes?