You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Thomas Andraschko <an...@gmail.com> on 2014/05/20 12:57:19 UTC

Data Module - Provide an abstract base entity class?

Hi,

WDYT about providing an abstract base entity?
I always copy this from project to project...

Here is a example: https://gist.github.com/tandraschko/a5a79c4edb3e742fc75b

Regards,
Thomas

Re: Data Module - Provide an abstract base entity class?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
well the class only implements equals/hashcode which are pretty simpler
without abstraction, that's why I asked. BTW we could add what spring-data
has with the Persistable hierarchy but then we should agree on the default
impl (and pretty sure we'll not: UUID, generated value as in spring-data
etc...).

PS: the hierarchy can be seen
http://grepcode.com/file/repo1.maven.org/maven2/org.springframework.data/spring-data-jpa/1.0.3.RELEASE/org/springframework/data/jpa/domain/AbstractAuditable.java?av=h#AbstractAuditable



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-05-20 13:07 GMT+02:00 Karl Kildén <ka...@gmail.com>:

> Hi,
>
> The gain is that the collective behind the data module are pretty much the
> people I would hire to write my base class if I could ;)
>
> It also unifies how stuff is done etc...
>
>
> On 20 May 2014 13:03, Romain Manni-Bucau <rm...@gmail.com> wrote:
>
> > Hi
> >
> > +-0 nothing particular against but not sure the real gain is
> >
> >
> >
> > Romain Manni-Bucau
> > Twitter: @rmannibucau
> > Blog: http://rmannibucau.wordpress.com/
> > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > Github: https://github.com/rmannibucau
> >
> >
> > 2014-05-20 12:57 GMT+02:00 Thomas Andraschko <
> andraschko.thomas@gmail.com
> > >:
> >
> > > Hi,
> > >
> > > WDYT about providing an abstract base entity?
> > > I always copy this from project to project...
> > >
> > > Here is a example:
> > > https://gist.github.com/tandraschko/a5a79c4edb3e742fc75b
> > >
> > > Regards,
> > > Thomas
> > >
> >
>

Re: Data Module - Provide an abstract base entity class?

Posted by Thomas Hug <th...@gmail.com>.
+0 Seen this in several places already, so people seem to like it ;) Agree
with Romain that it will be hard to come up with a reasonable impl (also
considering optimistic locking, timestamps, ...) - main reason auditing in
the data module is annotation- and not type-based.


On Tue, May 20, 2014 at 1:12 PM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> well the class only implements equals/hashcode which are pretty simpler
> without abstraction, that's why I asked. BTW we could add what spring-data
> has with the Persistable hierarchy but then we should agree on the default
> impl (and pretty sure we'll not: UUID, generated value as in spring-data
> etc...).
>
> PS: the hierarchy can be seen
>
> http://grepcode.com/file/repo1.maven.org/maven2/org.springframework.data/spring-data-jpa/1.0.3.RELEASE/org/springframework/data/jpa/domain/AbstractAuditable.java?av=h#AbstractAuditable
>
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-05-20 13:07 GMT+02:00 Karl Kildén <ka...@gmail.com>:
>
> > Hi,
> >
> > The gain is that the collective behind the data module are pretty much
> the
> > people I would hire to write my base class if I could ;)
> >
> > It also unifies how stuff is done etc...
> >
> >
> > On 20 May 2014 13:03, Romain Manni-Bucau <rm...@gmail.com> wrote:
> >
> > > Hi
> > >
> > > +-0 nothing particular against but not sure the real gain is
> > >
> > >
> > >
> > > Romain Manni-Bucau
> > > Twitter: @rmannibucau
> > > Blog: http://rmannibucau.wordpress.com/
> > > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > > Github: https://github.com/rmannibucau
> > >
> > >
> > > 2014-05-20 12:57 GMT+02:00 Thomas Andraschko <
> > andraschko.thomas@gmail.com
> > > >:
> > >
> > > > Hi,
> > > >
> > > > WDYT about providing an abstract base entity?
> > > > I always copy this from project to project...
> > > >
> > > > Here is a example:
> > > > https://gist.github.com/tandraschko/a5a79c4edb3e742fc75b
> > > >
> > > > Regards,
> > > > Thomas
> > > >
> > >
> >
>

Re: Data Module - Provide an abstract base entity class?

Posted by Karl Kildén <ka...@gmail.com>.
Hi,

The gain is that the collective behind the data module are pretty much the
people I would hire to write my base class if I could ;)

It also unifies how stuff is done etc...


On 20 May 2014 13:03, Romain Manni-Bucau <rm...@gmail.com> wrote:

> Hi
>
> +-0 nothing particular against but not sure the real gain is
>
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-05-20 12:57 GMT+02:00 Thomas Andraschko <andraschko.thomas@gmail.com
> >:
>
> > Hi,
> >
> > WDYT about providing an abstract base entity?
> > I always copy this from project to project...
> >
> > Here is a example:
> > https://gist.github.com/tandraschko/a5a79c4edb3e742fc75b
> >
> > Regards,
> > Thomas
> >
>

Re: Data Module - Provide an abstract base entity class?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

+-0 nothing particular against but not sure the real gain is



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-05-20 12:57 GMT+02:00 Thomas Andraschko <an...@gmail.com>:

> Hi,
>
> WDYT about providing an abstract base entity?
> I always copy this from project to project...
>
> Here is a example:
> https://gist.github.com/tandraschko/a5a79c4edb3e742fc75b
>
> Regards,
> Thomas
>