[4998] in java-interest

home help back first fref pref prev next nref lref last post

Re: Observable problems

daemon@ATHENA.MIT.EDU (Christopher Helck)
Thu Jan 25 13:07:05 1996

Date: Thu, 25 Jan 1996 11:02:07 -0500
From: chris@telesph.com (Christopher Helck)
To: neudeck.arthur@ch.swissbank.com, java-interest@java.sun.com


Regarding...,

> 
> Hoi Christopher ....
> 
> As I see things you made a little mistake within your applications
> design: An observable is holding business logic or data and provides
> their contents to observers. In your case the extension of a Panel
> implies that your observable is either an observer. So why don't you
> extract the observer functionality in another class ????
> 
> Sorry, I believe this is not the response you wanted to have, but I think it is
> the best solution :)
> 
> Have fun,
> 	Arthy
>

Actually I am interested in the best solution and I kinda agree with your
analysis even though I don't fully understand what you meant :-).

I understand that usually a Panel or Button isn't an Observable object -- they
have nifty event handlers and call back functions to call methods in other
objects and so forth. In my case I have some buttons that select parameters,
when a button is pressed a set of parameters is sent to one or more algorythm
objects, when these objects finish their calculations they send data to some
display objects -- the results of the different algorythms are displayed in
seperate windows.

It seems to make sense for the display objects to be observers of the algorythm
objects; this was easy to do and would allow me to display the results of an
algorythm in different ways.

Making the buttons be Observable strikes me as wrong -- it seems too passive --
but it would allow me to attach new algortyhm objects to a button.

Bottom line is I want a button that can send data to one or more objects which
will be created and destroyed independent of the button.

I hope this is clear. I'm playing with JAVA mainly to learn about OO and in the
hopes of getting a high paying, glamourous, exciting, but meaningfull job.

Having fun,
  Christopher J. Helck


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post