commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fernandez Martinez, Alejandro" <a.fernandez.marti...@ibermatica.com>
Subject RE: [OT] thoughts on Java pre processor
Date Thu, 07 Mar 2002 08:51:47 GMT
Hi Henri,

I never found myself in this situation, where a returned entity has no
meaning at all in the problem domain. Not in Java, not in C. Whenever I see
something like this, I consider it bad design; and returned an untyped
Object[] seems to me like very bad design. But it may very well be.

Well, since this is an OT thread, we can as well discuss theses things,
right? If you want to return two unrelated entities, then make two separated
methods that return each an entity. If you want to return related entities,
then turn them into an object and use it; usually it saves a lot of trouble
elsewhere.

It's possible I have worked in limited environments, but this problem is
common in other fields. Could you provide an example?

TIA,

un saludo,

Alex.

> -----Mensaje original-----
> De: Henri Yandell [mailto:bayard@generationjava.com]
> Enviado el: miƩrcoles 6 de marzo de 2002 21:43
> Para: Jakarta Commons Developers List
> Asunto: Re: [OT] thoughts on Java pre processor
> 
> 
> Heard the argument before :)
> 
> Too often Foo ends up being called 'Result' because there's 
> actually no
> concept that the multiple returned list returns.
> 
> OO involves designing with classes that map to domain 
> concepts. When the
> domain concept uses the Java language as a domain and the concept is
> JavaHasNoMultipleReturnObject, then it's not good OO :)
> 
> In reality you end up returning an array, which is fine except it is
> untyped and only handles Objects. I'd like it to handle 
> priomitives too
> and be typed.
> 
> Just a view :)
> 
> Hen
> 
> 
> On Thu, 7 Mar 2002, Colin Sharples wrote:
> 
> >
> > > I would like to see the ability to return multiple 
> objects. Not sure if
> > > this would be easy to do as it would require the 
> preprocessor to work
> > > across files, but I would like to do:
> > >
> > > int i;
> > > String str;
> > >
> > > (i, str) = runCode();
> >
> > public class Foo {
> >   private property int i;
> >   private property String str;
> > }
> >
> > Foo foo = runCode();
> >
> > It's called OO... :-)
> >
> > Regards
> >
> > Colin M Sharples
> > I/T Architect
> > IBM Global Services New Zealand
> >
> > email: sharples@nz1.ibm.com
> > phone: 64-4-5769853
> > mobile: 64-21-402085
> > fax: 64-4-5765616
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: 
> <mailto:commons-dev-help@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:commons-dev-help@jakarta.apache.org>
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message