Hi Ludwig, On 09.04.11 20:34, Ludwig Magnusson wrote: > If we keep this method this way, you always need do cast your user class to > MyUser when you want to access methods in MyUser. In my experience, the user > class is often heavily changed and therefore a good solution here would be > valuable. > > There are solutions, but implementing it is quite a bit of work, that's why > I want to discuss the solution before I begin. If anyone comes up with a > simpler solution, I would be very happy =)
I have a similar problem with the generic handling of the modules (Action, Screen and friends). I guess this is what annotations were invented for in the first place. My suggestion would be to do only the things absolutely necessary to get the milestone 1 out of the door and postpone the "real" solution to milestone 2 where the security stuff is about to be replaced anyway. Rather put your energy into tuning the fulcrum-security stuff. LDAP needs some testing, for example. > There is also a "trick" that I found in the book Effective Java by Joshua > Bloch (which I very much recommend btw). > > You can create a general method that looks like this: > > public <U> UserManager<U> getUserManager(Class<U> type) I like this one. That's how ArrayList.toArray(T[]) works. Maybe this can help me with the AssemblerBrokerService. Bye, Thomas --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
