Re: [Figleaf-developer] No need for proxies - at least at the moment
Status: Alpha
Brought to you by:
steckman
|
From: <sam...@ma...> - 2004-07-03 18:19:51
|
Quoting Greg Steckman <ste...@on...>:
> Hi Sam,
> >Do, but why does it need to be an instanceof? Surely the UI wuold just call
> >'getProperties' to expose the right views, which does it need to know the
> >specific class?
> >
> >
> >
>
> The UI will in some cases take one object, that is visible, and pass it
> to another object that is visible as a method parameter or to a property
> setter. If the first object isn't of the expected type, there will be a
> problem. I planned on having the UI inspect the class/interfaces objects
> implement when determining if they matched the types expected. If the
> object the UI has is really a delegate that doesn't implement all the
> interfaces and class hierarchy of the real class, then there will have
> to be extra code like "instance.getRealInstance()". But now that "real"
> object which will be used to set a property, won't implement Informative
> and therefore property set calls made to it by the second class won't
> have events fired, for example.
Of course you're right - I'll put the proxies back in.
> >
> >Which I have - I also have it implementing Observable. I would say that for
> the
> >first version we provide the implementation of Observable and add the code
> later
> >on which will allow users to define their own.
> >
> >
> >
> For now I'd even settle for just requiring objects to implement
> Informative completely themselves and get the persistence and UI layers
> worked out. It'll then be a functional platform to some extent. That's
> the approach I've taken so far.
Well, my code handles objects which haven't implemented Informative (in fact
thats what 80% of what I've done so far does) so we don't have to worry about
that. I actually believe one of the big selling points is the lack of work a
developer has to do to get up and running, for that reason I'd like for the 0.1
release for the developer to drop a vanilla pojo domain model in and have to do
no work for it to run.
My todo list once I've put proxies back in is a little sparse - might thought
was that I should look at our API for typing the layers together. We want an API
that lets us configure Spring (or Pico or whatever). I saw a bit of code like
this written by the developer:
public class MyFigleafApplication extends FigleafApplication {
public void setup() {
setPersistenceMechanism(new HibernateImpl("config.hbm.xml"));
setUIMechanism(new SwingImpl());
...
registerClass(MyClass.class);
registerClass(AnotherClass.class);
}
public static void main(String[] args) {
new MyFigleafApplication().run();
}
}
We may want to use config files for this later on, but for now doing it using
Java code makes it easy to test and lets us concentrate on the important stuff.
What do you think?
sam
http://www.magpiebrain.com/
|