Wow that really violates the separation of commands and queries. Just
curious, why is it necessary to return three different things. Why not just
havve it return an Integer constant, and then based on that constant work
from there? Is there a significant efficiency difference or something. It
seems that returning three different object would unnecassarily obfuscate
your code.
----- Original Message -----
From: "Paraskevas Orfanides" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 14, 2001 10:59 AM
Subject: Re: [JAVA3D] InputDevice and Behavior
> Why don't you enumarate integers FALSE, TRUE, VOID? This way one function
> will return one of three integers, each with a meaningful use. Then you
> can check which one was returned and act appropriately. This will save
you
> from the trouble of having to deal with returning types.
>
> --- Justin Couch <[EMAIL PROTECTED]> wrote:
> > On Thu, 11 Jan 2001, Dipl. Ing. Paul Szawlowski wrote:
> >
> > > I just encountered a problem which I think should get resolved.
> > > I wanted to implement a class which implements the InputDevice
> > interface
> > > and inherits from Behavior.
> >
> > Ummm... without knowing the exact details of what you are are doing,
this
> > sounds like something that will get very nasty very quickly. What you
> > have
> > are two separate threaded entities working together within a single
> > class.
> > Something that is a design issue that is marked as 'Don't do@ in any
> > mutlihtrreaded classes ever taught. If you need these talking togehter
> > then
> > you should do this via a thirdparty class using a standard
> > producer-consumer
> > model. This will avoid deadlocks that will occur in your application
that
> > putting the two threads into the one class will do.
> >
> > > For that I need unfortunatly a method initialize with no parameters
> > > which shall return void in one case and boolean in the other.
> >
> > Talk to the langauge designers. That's a Java language issue and not one
> > you
> > will get a positive answer for. Having the same method signature but
> > different
> > return value types is not a capability of any strongly typed language
> > that
> > I am aware of.
> >
> > --
> > Justin Couch Author, Java Hacker
> > Software Architect [EMAIL PROTECTED]
> > J3D.org http://www.vlc.com.au/~justin/
> > Java3D FAQ http://www.j3d.org/faq/
> > -------------------------------------------------------------------
> > "Look through the lens, and the light breaks down into many lights.
> > Turn it or move it, and a new set of arrangements appears... is it
> > a single light or many lights, lights that one must know how to
> > distinguish, recognise and appreciate? Is it one light with many
> > frames or one frame for many lights?" -Subcomandante Marcos
> > -------------------------------------------------------------------
> >
> >
>
===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> > body
> > of the message "signoff JAVA3D-INTEREST". For general help, send email
> > to
> > [EMAIL PROTECTED] and include in the body of the message "help".
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".