You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by DeWitt Clinton <de...@avacet.com> on 2000/06/01 00:19:39 UTC

[OT] Bean::*?

Hi all,

Okay, this is a rather ridiculous question.  I spent the weekend
implementing a property based object model in Java.  However, after I
finished, someone in my company laughingly pointed out that I had just
re-invented Java beans.  While there were some minor advantages to the
model I came up with, the overwhelmingly richer feature set of the
java.beans.* framework made my efforts redundant at best.

One of the advantages, however, is that the object model I was working
on would translate very nicely to Perl.  In fact, the language
independent nature of this (other than OO being a requirement) was the
real reason I bothered with it at all.

My question is this -- has anyone written an implementation of the
Java Bean standard in Perl?  I don't think we need to have a major
debate about the shortcomings of beans on the mod_perl list.  But I am
wondering if anyone has pulled this off yet.  If we left out the event
driven parts of the bean spec, and just focused on the property side
of things, this could be a rather short project to get the core down.

I'd like to see the Perl version be API compatable with the Java
version.  There is no need to take it much further.

Thoughts?  Flames?  :)

-DeWitt

Re: [OT] Bean::*?

Posted by DeWitt Clinton <de...@avacet.com>.
On Wed, May 31, 2000 at 04:16:09PM -0700, Perrin Harkins wrote:

> Maybe I'm just being thick, but if you leave out the event driven parts of
> the spec, what's left that isn't just an ordinary Perl class?  You can
> easily make classes to hold data using Class::Struct or
> Class::MethodMaker.

In all this time, I don't think I've seen you simply being thick even
once.  :) I agree, if you take out the event driven stuff, beans
aren't that exciting.  They are basically just property bags with a
way to reflect over those properties.  However, if I build the
beginning of the bean model in Perl, then someone might come along and
add the event model.

> Is it just that you want a safer way to do introspection than looking at
> the data structure the class is made from?  Maybe you want the
> Class::Fields module from CPAN.

Trust me -- this has nothing to do with "safe."  :)  The bean model is 
simply a convention -- if a class has a getFoo and a setFoo, then it
has the property Foo.  Like I said, I don't want to debate whether or
not it is a good standard.  The entire point is to have a consistent
framework between Java and Perl.  Chances are, the underlying
mechanism for doing the reflection will leverage something from the
Class:: package. 

There are a million ways I'd rather see this solved in Perl.  Or in
Java for that matter.  But java.beans are pretty popular, and they
provide the underpinnings for EJB, which, for better or for worse, is
very prevalent in e-commerce.  I'd rather support a mediocre standard
then invent a proprietary one.  And beans aren't *that* mediocre.

-DeWitt

Re: [OT] Bean::*?

Posted by Perrin Harkins <pe...@primenet.com>.
On Wed, 31 May 2000, DeWitt Clinton wrote:
> My question is this -- has anyone written an implementation of the
> Java Bean standard in Perl?  I don't think we need to have a major
> debate about the shortcomings of beans on the mod_perl list.  But I am
> wondering if anyone has pulled this off yet.  If we left out the event
> driven parts of the bean spec, and just focused on the property side
> of things, this could be a rather short project to get the core down.

Maybe I'm just being thick, but if you leave out the event driven parts of
the spec, what's left that isn't just an ordinary Perl class?  You can
easily make classes to hold data using Class::Struct or
Class::MethodMaker.

Is it just that you want a safer way to do introspection than looking at
the data structure the class is made from?  Maybe you want the
Class::Fields module from CPAN.

- Perrin


Re: [OT] Bean::*?

Posted by Matt Sergeant <ma...@sergeant.org>.
On Wed, 31 May 2000, DeWitt Clinton wrote:

> Hi all,
> 
> Okay, this is a rather ridiculous question.  I spent the weekend
> implementing a property based object model in Java.  However, after I
> finished, someone in my company laughingly pointed out that I had just
> re-invented Java beans.  While there were some minor advantages to the
> model I came up with, the overwhelmingly richer feature set of the
> java.beans.* framework made my efforts redundant at best.
> 
> One of the advantages, however, is that the object model I was working
> on would translate very nicely to Perl.  In fact, the language
> independent nature of this (other than OO being a requirement) was the
> real reason I bothered with it at all.
> 
> My question is this -- has anyone written an implementation of the
> Java Bean standard in Perl?

CORBA::ORBit?

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org