Re: [Figleaf-developer] Proxies back in and some thoughts on the Bootstrapper
Status: Alpha
Brought to you by:
steckman
|
From: Greg S. <ste...@on...> - 2004-07-05 15:05:58
|
sam...@ma... wrote: > >I have a few concerns with using setter-based injection - primarily the fact >that you can end up creating a bean which cannot then be used without setters >being called (sometimes in a certain, special order). A case in point would be >the FormView, where if you call setViewObject before setSwingViewer, you get a >null pointer exception. By passing in all dependencies at construction not only >do you ensure the object starts in a valid, ready to use state, but you also >make sure that setters which should not be used at any other time other that >initialisation are not exposed - what happens for example if something calls >setSwingViewer after the FormView has already been displayed? > > > Yeah I did some cleanup of that code last night. Should be a little harder to get a NPE now. There are still two setters required if you want to use a view as a field as it requires two extra properties, so the constructor for all views only have 2 parameters to be consistent (since they are created via reflection). I'll have to think about this one more if it's a problem still. >>Do you have in mind how to allow the developer to override the default >>view types and to provide additional view types? >> >> > >Definately. A case in point would be the Image manager app I'd like to code by >way of an acceptance test - in once object you have a String which represents a >filename, but I want the GUI to provide a file browser. > > > What I meant is, do you have any ideas of how to do the configuration while still hard coding defaults? Greg |