Hi,

After David's explanations I've started favoring option 1) (i.e. separate
annotations for ViewModel).

I am not into DDD (yet!) and I haven't seen a simple and clear example of
ViewModel in action, so I cannot still visualize it in my head.
I understand Dan's suggestion to make everyone happy by supporting two ways
to define the same but adding to the mix "implements ViewModel" (see
org.apache.isis.applib.ViewModel vs.
org.apache.isis.applib.annotation.ViewModel) makes it even harder for me to
decide which approach would be the best for my future use cases.

Assuming we have a @DomainObject with 3 natures (jdo, external and
view_model) then what would be the expected behavior of:

@DomainObject(nature=jdo)
public class Foo implements ViewModel, ... { ... }

?

I guess the metamodel validation should tell me that I'm doing something
fishy here ?! Is there such validation in Isis runtime now ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sat, Jan 3, 2015 at 8:44 PM, GESCONSULTOR <o....@gesconsultor.com> wrote:

> Good consensus for me also :)
>
>
>
> > El 3/1/2015, a las 18:48, Branham, Jeremy [HR] <
> jeremy.d.bran...@sprint.com> escribió:
> >
> > This is a good compromise IMHO.
> >
> >
> > Jeremy D. Branham
> > Tel: **DOTNET
> >
> >
> > -----Original Message-----
> > From: Dan Haywood [mailto:d...@haywood-associates.co.uk]
> > Sent: Saturday, January 03, 2015 7:27 AM
> > To: users
> > Cc: dev@isis.apache.org
> > Subject: Re: ISIS-970 ... (new annotations) please review if you get a
> chance...
> >
> >> On 3 January 2015 at 13:14, Jeroen van der Wal <jer...@stromboli.it>
> wrote:
> >>
> >>
> >> I have one more thought: since @ViewModel and
> >> @DomainObject(nature=UI_VIEW) are the same concepts it might be more
> >> intuitive to use
> >> @DomainObject(nature=VIEW_MODEL)
> >
> > Yes, that probably does make sense; we are just providing two equivalent
> syntaxes for describing a (UI) view model.
> >
> > So the revised proposal is:
> >
> > for the UI/app layer, retain/introduce:
> > * @ViewModel
> > * @ViewModelLayout
> >
> > for the domain layer:
> > * @DomainObject(nature=JDO_ENTITY | EXTERNAL_ENTITY | VIEW_MODEL)
> > * @DomainObjectLayout
> >
> > for both:
> > * @Property(domainEvent=..., ) and @PropertyLayout
> > * @Collection(domainEvent=..., ) and @CollectionLayout
> > * @Action(domainEvent=..., ) and @ActionLayout
> > * @Parameter and @ParameterLayout
> >
> > where @ViewModel and @DomainObject(nature=VIEW_MODEL) are basically
> equivalent; choose whichever notation you prefer (and use a metamodel
> validator to exclude the other).
> >
> >
> > thx
> > Dan
> >
> > ________________________________
> >
> > This e-mail may contain Sprint proprietary information intended for the
> sole use of the recipient(s). Any use by others is prohibited. If you are
> not the intended recipient, please contact the sender and delete all copies
> of the message.
>

Reply via email to