+1

On 4/17/06, Allen Gilliland <[EMAIL PROTECTED]> wrote:
> yeah, that definitely may be a better route to go.  the only reason why
> i proposed explicit addXXX() and storeXXX() methods is because there are
> a number of manager methods like the current createWebsite() which
> actually does more than just save an object.  I suppose that for those
> specific situations we can create an addXXX() method which will be the
> same as a save, but would have some extra work attached.
>
> so with that modification we would have ...
>
> saveXXX() - equivalent to hibernate saveOrUpdate() or sql insert or update.
>
> removeXXX() - equivalent to hibernate delete() or sql delete.
>
> getXXX() - a query.
>
> and we would have addXXX() methods in cases where it makes sense.
>
> -- Allen
>
>
> Matt Raible wrote:
> > I'd go with saveXXX() instead of addXXX and storeXXX.  In most cases,
> > it'll be up to the persistence layer to determine insert/update.  This
> > is what I generally do in my apps - but Roller might be different.  I
> > don't know if we have any custom logic for add vs. update.
> >
> > Matt
> >
> > On 4/17/06, Allen Gilliland <[EMAIL PROTECTED]> wrote:
> >> this isn't part of the backend refactoring proposal because it doesn't
> >> serve any functional purpose, but would anyone be opposed to me renaming
> >> some of the manager methods just to get them all conformed to a standard
> >> convention?
> >>
> >> i am thinking we would structure the methods like this ...
> >>
> >> addXXX() - add new item.  equivalent to hibernate save() or sql insert.
> >>
> >> storeXXX() - update existing item.  equivalent to hibernate
> >> merge()/update() or sql update.
> >>
> >> removeXXX() - remove existing item.  equivalent to hibernate delete() or
> >> sql delete.
> >>
> >> getXXX() - for any queries.
> >>
> >> and we would remove createXXX() methods from managers because they seem
> >> pretty useless and it seems better if new object instances are just
> >> created directly using the pojo constructors.
> >>
> >> so this won't be changing any functionality of the code it will
> >> basically just be renaming a bunch of methods to make things more
> >> consistent.  the biggest changes will be moving a number of
> >> retrieveXXX() methods to getXXX() methods, and removing the createXXX()
> >> methods.
> >>
> >> anyone object or have some alternative ideas?
> >>
> >> -- Allen
> >>
>

Reply via email to