You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Paul Hammant <Pa...@yahoo.com> on 2002/01/21 12:01:48 UTC

[Fwd: New Project - Alternative Java Beans]

Folks,

I posted this in avalon-apps-dev@jakarta.apache.org
You may be interested in its subject matter.

For "I'd like to get involved" type comments, that mail-list would be 
best joined.  For disses, put downs etc, here in avalon-dev is fine :-)

- Paul


-------- Original Message --------
Subject: New Project - Alternative Java Beans
Date: Sun, 20 Jan 2002 22:03:51 +0000
From: Paul Hammant <Pa...@yahoo.com>
Reply-To: "Avalon Applications Developers List" 
<av...@jakarta.apache.org>
To: avalon-apps-dev@jakarta.apache.org

Folks,

Perhaps I'm guilty of thinking of a use for AltRMI.  Perhaps as has been
suggested I have some sort of compulsion to code.  I've talked this
through with Gerhard and he thinks at worst it is a good design
excercise for Pheonix app construction.  He thinks at best it could be
viable as a application server, though perhaps not for some time.

*Exec Summary*

An alternative to EJB.  Either to be known as AltJB or AJB.  Based on
Avalon-Framework lifecycle methods/interfaces.  Uses AltRMI for glue
between beans, either in the same container or from/to elsewhere.

*List of Features*

Different to EJB in these ways:

a) Sitting on Phoenix (it is itself a regular SAR file app)
b) Using AltRMI (no remote or home interfaces needed)
c) Uses IoC for all actions.  Most of the Avalon Framework intefaces are
just as applicable (Composable, LogEnabled, Configurable).
d) As consequence of (b) and (c) no JNDI needed for bean lookup.
e) Can use other services provided by underlying phoenix machine.
f) Lessof a distinction between session and entity beans.

The same as EJB in that:

g) beans come in jars that have xml for config.
h) beans in separate classloaders.
i) they don't actually know whether the bean they are depending on is
local or remote.

*Justification from Modelling point of View*

_Steps to build an AJB app_

Define a java-interface model of your application.  Remember that
following the facade pattern in the context of EJB, we decide which
things are beans and which are "Value Objects" (is that term in common
use yet?).

   interface Family {
     Person addNewBorn(String name, Date dob);
     Person[] getPeople();
   }
   interface Person {
     getName();
     getDOB();
     getGender();
   }
   interface MalePerson extends Person {
     getBeardColor();
   }

Clearly Family would be a facade and Person (and its derivatives) would
be value objects.

Given that both EJB and Avalon advocate separation of interface and impl
we can understand without detailed explanation that the Family facade
could have multiple implementations.  One could use Cornerstone's Store
or Gerhard's commons Store for persistence, another could use JDBC for
storage.  These multiple implementations could share common code and
abstract the differernces away conveniently.

*What would the jar contain?*

Well along the lines of EJB, some classes, a manifest and some XML on
the same lines as ejb-jar.xml

*How does this differ to Phoenix proper?*

Good question.  Both Pheonix and AJB support apps distributed in zip/jar
form mounted into a container.

My feeling is that there are some small differences :

1) Scope of hosted apps

In Phoenix the app hosting allows full server applications.  The apps
have no cap on their activities.  They can spawn multiple threads and
classloaders and implement any weird and wacky server concept.  IETF RFC
& standard server concepts are favourite.

With AJB the bean is constrained.  It should not pawn threads or mount
classloaders. It should be a simple request/reply bean that may or may
not have state and may or may not be able to persist itself.

2) Packaging

Pheonix takes sars that have jars inside.  AJB has very simple jars :

   MyBean.jar --->
   myco/facades/Family.class
   myco/impl/DefaultFamily.class
   myco/shared/Person.class
   myco/shared/MalePerson.class
   myco/shared/FemalePerson.class
   AJB-INF/ajb-jar.xml

I.e. no other jars.  Simple and small.  Directly mountable into a URL
classloader.

3) Life Cycle

At this stage I don't think that Framework's Startable is needed.
  Methods start() and stop() don't seem to me (at this stage) to fit
application server bean.  LogEnabled, Configurable, Composable all seem
to fit.  Also there is need for some IoC/EJB like instructional
interfaces.  Methods activate() & passivate() seem to have suitablility.

4) Replacability whilst in use.

EJB does it (in theory) and AJB should to, the bean itself should be
able to be replace/upgraded whilst in use.  Pheonix will want to stop(),
<replace>, start() the app.

5) ComponenetManager

AJB would mount its own component manager. When a lookup on a role is
done by a AJB bean, then the it could be for other AJB beans (local or
remote) or for an underlying Phoenix service, like say the most
excellent Jo!

We could specify a context like prefix for the AJbeans....

   Family family = (Family) mComponentManager.lookup("AJB:Family");
   JoService joService = (JoService)
mComponentManager.lookup("Phoenix:JoService");

In the case of the latter, the AJB container would reroute this request
as...

    return mPhoenixComponentManager.lookup("JoService");

*Unresolved questions*

Should we/I start this in <Cornerstone>/apps/ajb ?
Or should we choose SourceForge for a change (albeit with Apache license)?

Gerhard thinks it will be easier to build a community on sourceforge.
  Something that others find way easier to do!

Regards,

- Paul H


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Fwd: New Project - Alternative Java Beans]

Posted by Paul Hammant <Pa...@yahoo.com>.
Peter,

>http://jiapi.sourceforge.net/
>
>May be interesting to look at ;)
>
It was not quite what I wanted, but lead me on to.....

    http://www.alphaworks.ibm.com/tech/jikesbt

    - very interesting.  Looks to be just what I want. Unknown license. 
 Not downloadable at present

and

    http://www.alphaworks.ibm.com/tech/jcbroker

    - Looks to be exactly the same as AtlRMI. $1000 commercial license. 
 Not downloadable at present

- Paul




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Fwd: New Project - Alternative Java Beans]

Posted by Peter Donald <pe...@apache.org>.
On Wed, 23 Jan 2002 21:01, Paul Hammant wrote:
> It is the dynamic generation of code that I am having my biggest problem
> with for AltRMI. I've looked at BCEL and find it too complicated with
> examples that are not clear enough.  There are other things like AspectJ
> and JCFE that have been recomended, I'm sure I'll get there in the end.

http://jiapi.sourceforge.net/

May be interesting to look at ;)

-- 
Cheers,

Pete

*------------------------------------------------------*
| Despite your efforts to be a romantic hero, you will |
| gradually evolve into a postmodern plot device.      |
*------------------------------------------------------*

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Fwd: New Project - Alternative Java Beans]

Posted by Paul Hammant <Pa...@yahoo.com>.
Incze,

Thanks for this fairly weighty analysis & cut/paste job..

>Today have a reading day. There is an interview on the ServerSide on
>the J2EE compatibility testing. The last Q/A pair is this:
>
>--
>Marinescu: What features should we anticipate in J2EE 1.4?
>
>Shannon: Web services, web services, and more web services! 
>
I can't help feeling that the preoccupation with queryable web services 
is a consequence of bogus firewall policies.

>Support
>for web service standards such as SOAP/HTTP and WSDL is the primary
>goal of J2EE 1.4. J2EE 1.4 will be the best platform for deploying
>and accessing web services. Much work is underway in the Java Community
>Process to define the components needed to supply full support for web
>services. One of the major components, the JAX-RPC technology, will be
>delivered before J2EE 1.4 and will be usable on J2EE 1.3 products.
>
>J2EE 1.4 will also deliver on work in progress to improve the support
>for J2EE tools, and will provide minor enhancements to existing APIs
>as required.
>--
>
>I've started to check this jax-rpc (whether it will work in the GLUE way
>or not) and found (in http://java.sun.com/xml/jaxrpc/primerarticle.html)
>
>--
>The JAX-RPC supports creation of a dynamic proxy for invoking a service
>endpoint. A dynamic proxy class supports a service definition interface
>dynamically at runtime without requiring any code generation of a stub class
>that implements a specific service definition interface. The following example
>shows the use of a dynamic proxy for invoking an operation on the target
>service endpoint. Note that this example does not use any generated stub
>class that implements the StockQuoteProvider service definition interface...
>
It is the dynamic generation of code that I am having my biggest problem 
with for AltRMI. I've looked at BCEL and find it too complicated with 
examples that are not clear enough.  There are other things like AspectJ 
and JCFE that have been recomended, I'm sure I'll get there in the end.

>--
>
>So. It'll be standard. (However - we allways have a however - the service
>definition interface extends java.rmi.remote and drops remote exception.)
>
Ahhh there is the catch.  On my travels I'm encountering about 30% of 
experienced Java coders think that Remote & RemoteException is bad thing.

Regards,

- Paul H


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Fwd: New Project - Alternative Java Beans]

Posted by Incze Lajos <in...@mail.matav.hu>.
On Mon, Jan 21, 2002 at 11:01:48AM +0000, Paul Hammant wrote:
> Folks,
> 
> I posted this in avalon-apps-dev@jakarta.apache.org
> You may be interested in its subject matter.
> 
> For "I'd like to get involved" type comments, that mail-list would be 
> best joined.  For disses, put downs etc, here in avalon-dev is fine :-)
> 
> - Paul
> 
Today have a reading day. There is an interview on the ServerSide on
the J2EE compatibility testing. The last Q/A pair is this:

--
Marinescu: What features should we anticipate in J2EE 1.4?

Shannon: Web services, web services, and more web services! Support
for web service standards such as SOAP/HTTP and WSDL is the primary
goal of J2EE 1.4. J2EE 1.4 will be the best platform for deploying
and accessing web services. Much work is underway in the Java Community
Process to define the components needed to supply full support for web
services. One of the major components, the JAX-RPC technology, will be
delivered before J2EE 1.4 and will be usable on J2EE 1.3 products.

J2EE 1.4 will also deliver on work in progress to improve the support
for J2EE tools, and will provide minor enhancements to existing APIs
as required.
--

I've started to check this jax-rpc (whether it will work in the GLUE way
or not) and found (in http://java.sun.com/xml/jaxrpc/primerarticle.html)

--
The JAX-RPC supports creation of a dynamic proxy for invoking a service
endpoint. A dynamic proxy class supports a service definition interface
dynamically at runtime without requiring any code generation of a stub class
that implements a specific service definition interface. The following example
shows the use of a dynamic proxy for invoking an operation on the target
service endpoint. Note that this example does not use any generated stub
class that implements the StockQuoteProvider service definition interface...
--

So. It'll be standard. (However - we allways have a however - the service
definition interface extends java.rmi.remote and drops remote exception.)

incze

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Fwd: New Project - Alternative Java Beans]

Posted by Paul Hammant <Pa...@yahoo.com>.
Incze

>
>I've just saw this today on Jguru, some parallel effort to this plan (tough
>they work kwith some language extension).
>
>http://wwwipd.ira.uka.de/JavaParty/
>http://wwwipd.ira.uka.de/~hauma/KaRMI/
>
Very interesting solution.  It does involve a language enhancement 
though : http://wwwipd.ira.uka.de/JavaParty/syntax.html

As such, and given Sun's wibblings on rt.jar bootstrapping and JVM mods, 
unless Sun endorses it it will go nowhere...

- Paul


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Fwd: New Project - Alternative Java Beans]

Posted by Incze Lajos <in...@mail.matav.hu>.
On Mon, Jan 21, 2002 at 11:01:48AM +0000, Paul Hammant wrote:
> Folks,
> 
> I posted this in avalon-apps-dev@jakarta.apache.org
> You may be interested in its subject matter.
> 
> For "I'd like to get involved" type comments, that mail-list would be 
> best joined.  For disses, put downs etc, here in avalon-dev is fine :-)
> 
> - Paul
> 
...

I've just saw this today on Jguru, some parallel effort to this plan (tough
they work kwith some language extension).

http://wwwipd.ira.uka.de/JavaParty/
http://wwwipd.ira.uka.de/~hauma/KaRMI/

incze

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>