Re: [NetBeans]changing menuitems
- From: RedGrittyBrick <RedGrittyBrick@xxxxxxxxxxxxx>
- Date: Mon, 28 Jul 2008 10:15:01 +0100
thufir wrote:
On Sun, 27 Jul 2008 23:46:14 +0100, RedGrittyBrick wrote:
// APPLICATION
Gen() {
GenModel model = new GenModel();
GenControl controller = new GenControl(model); JFrame view =
new GenListView(model, controller);
view.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
view.pack();
view.setLocationRelativeTo(null);
view.setVisible(true);
}
How would you achieve the same effect without passing parameters to constructors? Is that an unavoidable step?
Oh yes, another way is "Dependency Injection" or "Inversion of Control".
I'm not a fan of that since it seems heavyweight and looks rather mysterious and like magic to the casual reader.
E.g. http://www.picocontainer.org/ though I think Spring etc do this too. Picocontainer seems pleasantly lightweight and simple. Relatively.
--
RGB
.
- References:
- [NetBeans]changing menuitems
- From: Daniel Moyne
- Re: [NetBeans]changing menuitems
- From: Mark Space
- Re: [NetBeans]changing menuitems
- From: Daniel Moyne
- Re: [NetBeans]changing menuitems
- From: Mark Space
- Re: [NetBeans]changing menuitems
- From: Daniel Moyne
- Re: [NetBeans]changing menuitems
- From: RedGrittyBrick
- Re: [NetBeans]changing menuitems
- From: thufir
- [NetBeans]changing menuitems
- Prev by Date: Re: [NetBeans]changing menuitems
- Next by Date: Re: Use yahoo mail for authentication
- Previous by thread: Re: [NetBeans]changing menuitems
- Next by thread: where is the java preferences file located
- Index(es):
Relevant Pages
|