I'd be good with introducing optimistic locking, if we can do without
complicating the design. It would be fun to have a standard example of
doing something fancy like displaying both entries and letting the
cilent choose one.

The MailReader has always been a useful example, but it has always
lacked a realistic edge. Of course, we also need to reintroduce
authorization. :)

AFAICT, the current design is strongly implied by a number of key
Struts 2 features, like string-to-object type conversion and
persistent URL attributes. I also tried using model driven, but that
started to conflict with type conversion and the new i18n idioms.

A key technique is accepting the notion of "Transient" properties as a
valid approach to extending an entity object to include properties
found only in the view. Since Transient is part of the JPA, the
implication seems to be that entities are adapters between the
one-true-model (the persisted database) and the view layer, meaning an
entity object can contain properties from both worlds.

Of course, whether Transient properties are a good idea is something
one could take up with the expert group (along with the SQL tags in
the JSTL!), but since this is a JPA MailReader, I'm comfortable
adopting a JPA world view :)

As mentioned, the merging is busted ATM. It was working, but then I
started fussing with the high-level design. It was keeping a User and
Subscription in session to edit, but that seems like such a
heavy-handed restriction.

-Ted.

On Nov 15, 2007 10:58 AM, Tom Schneider <[EMAIL PROTECTED]> wrote:
> Are you worried about optimistic locking at all?  (I'm guessing not
> for this simple example)  Although I think your technique is clever,
> in a situation where optimistic locking is used, you should really be
> editing the object that was originally read from the database.  Might
> I suggest the scope plugin.  :)
>
> I'm not sure we'd want to introduce optimistic locking in a simple
> example--although it would be good to have one example that uses it.
> Tom
>
>
> On Nov 15, 2007 2:54 AM, Ted Husted <[EMAIL PROTECTED]> wrote:
> > I'm starting to make some progress on this again. I having great fun
> > re-discovering how some of the S2 features work together. For example,
> > custom type converters and "persistence URL parameters" are a great
> > "tag team". Given a converter for "user", and a parameter like
> > "?user=husted", S2 can automatically restore the "husted" user from
> > the database, and any other url tags on the result page are also
> > automatically embellished with "?user=husted" again.
> >
> > Though, there's more to do, since the JPA merging isn't working quite
> > right yet. :(
> >
> > -Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to