Von: Patrik Nordwall [mailto:patrik.nordw...@gmail.com]
> I can probably help you more with the customization if you like, but
> then I need more information and an example to be able to understand 
> exactly what you would like to do.

Okay, I will try to explain my problem more detailed.

I have several entity classes that have different semantics but same syntax.
They are called Type because - they typify other objects. 
Therefore they consist of a short key string and a description.
Such a type could be currency with the ISO 3 letter key and the currency's name 
or the ISO language code and the language's name.

For accessing from outside they all have the same pattern:
- Get all elements of a type. 
- Get one element by its key. 
- Add an element.
- Change an element.
- Remove an element.

(Hm, sounds like scaffold...)

Now I have a dozen of this types. 
Creating one service function for each type and each access mode is not very 
object oriented.
Also I would get a service with about 60 almost identical functions. 
So with generics it shrinks to one function for each access mode.

<T extends Type> T add(T t);
<T extends Type> T save(T t);
<T extends Type> T remove(T t);
<T extends Type> Collection<T> findAll(Class<T> clazz); 
<T extends Type> T findByKey(Class<T> clazz, String key);

But the model language does not allow such generics. 
Which makes it hard to write such a service.

I hope, this could clearify my intentions.


Regards,
Sascha Broich
-- 
TSA - Teleport Sachsen-Anhalt Service GmbH
Delitzscher Straße 70, 06112 Halle
Phone: +49 39203 8 2524 
Email: sascha.bro...@tsa.de

Firmensitz: Steinfeldstraße 5, D-39179 Barleben
Geschäftsführer: Marco Langhof
Amtsgericht: Stendal HRB 6388
http://www.tsa.de
------------------------------------------------------------------------------
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to