Re: Framework Annotations On Domain Objects
vvernon_shiftmethod <vvernon <at> shiftmethod.com>
2010-01-01 19:32:43 GMT
> only question is where to put information about
> what to index. If I put it in the domain, then
> some of those things will be there just because
> the UI needs to query it. If I don't put it there
> it would have to be done through other more
> cumbersome methods, and it won't be as easily
> visible.
That's what leads me back to language, which is DSL in my case. I can concentrate metadata on whatever type I
need, and then generate the pieces elegantly. If I need an index on an attribute/property or a group of them
I just declare it in the DSL, the index shows up in the right place, and neither my UI nor my model need to know
about it. The same thing goes for various finders on repositories.
Even though annotations, when really well designed, fit in in many or most cases, I generally always find a
place where it is uncomfortable at best. It's one of the main reasons I didn't use an annotation approach
for my tool. Of course nothing is perfect, and admittedly there are reasons some don't like DSLs or
abstract modeling of any kind. So even if Qi4j has some "gray" areas it might not be so bad as to call it a wart.
Maybe your quandary is pointing to a need that isn't annotation based. Would there be an acceptable way to
declare what is needed without using annotations? A very skinny DSL or something like that could be
better, especially if it were strongly UI oriented and only referential to the model. Maybe there are even
other UI concerns that would find a good home there.
Vaughn
--- In domaindrivendesign <at> yahoogroups.com, Rickard Öberg <rickardoberg@...> wrote:
>
> On 2009-12-30 17.07, vvernon_shiftmethod wrote:
> > @Rickard: Perhaps you want to put it on the UI and inject it onto the
> > domain object(s) during build or startup (AOP).
>
> Well, the code to actually do the indexing is totally separate, so the
> only question is where to put information about what to index. If I put
> it in the domain, then some of those things will be there just because
> the UI needs to query it. If I don't put it there it would have to be
> done through other more cumbersome methods, and it won't be as easily
> visible.
>
> /Rickard
>
------------------------------------