Even if the common logic was abstracted into an abstract class, you still have to update every model in the application to use this new abstract model. This is a much more expensive change than registering an component instantiation listener.
also, your assuming you can have *one* abstract model that satisfies *every* usecase. Realistically, you'll have to recreate a large number customized models (Coumpound, Property, Nested, etc). this is a real PITA. On 5/13/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
But where are you testing it up with your ComponentInstantationListener?? If it really has to be for every model. Then you could have a common base class or just attach it auto on every (Form)component? johan On 5/13/07, Ryan Sonnek <[EMAIL PROTECTED]> wrote: > > On 5/13/07, Johan Compagner <[EMAIL PROTECTED]> wrote: > > but that can't be done on instantiation because you have no idea when > the > > model is set. > > also you can have inhertiable models and so on. > Understood. That's why i need a "new" hook instead of onInstantiated() > > > But you want to do something when it has a specific model? > > That can already be done > > Let the model implement IComponentAssignedModel then you get a call: > > wrapOnAssignment > > just return this (that should work) and do you thing on the component > you > > get > Okay, well that's a start. The downfall with this approach is that > you have to change *every* model in the system to use this interface. > The reason for using the ComponentInstantiationListener is to make > *sweeping* application wide changes in one spot. > > my current app is relatively small, so it's not that big of a deal. > But the hibernate component instantiaion listener is useless without > this new hook. >
