| newbie: Global EJB and more ... |
|
| Author |
Message |
Steven Woody

|
Posted: 10/20/2003 11:53:00 PM |
Top |
java-programmer, newbie: Global EJB and more ...
Hi group,
While thinking of how to transfer a tranditional client-server app
into J2EE, I got following two questions:
1, In a typical application, there should be some global (even
singleton) objects which are created on application startup code and
stay there until the program exiting. In the idiom of J2EE, what kind
of Beans act like this kind of global object? And, when and how these
global beans should be created?
2, I knew Beans have to be deployed onto the server before they come
to be available, but those Beans quit often need some objects to
complete its job, these objects may encapsulate a algorithem, may do
some management task, but they typically dont have to exposed to
client tire or web tire. I call these objects are intermediate
objects. My question is, should this kind of objects need to be a EJB?
My J2EE books seems only to mention three kinds of Beans,
SessionBeans, EntityBeans and MessageBeans. But what do I do for those
intermediate objects?
Thanks in advance.
--
email***@***.com
%% (fortunes)
Q: How did you get into artificial intelligence?
A: Seemed logical -- I didn't have any real intelligence.
|
| |
|
| |
 |
Chiron Paixos

|
Posted: 10/21/2003 1:06:00 AM |
Top |
java-programmer >> newbie: Global EJB and more ...
On Mon, 20 Oct 2003 23:52:47 +0800, Steven Woody wrote:
>
>Hi group,
>
>While thinking of how to transfer a tranditional client-server app
>into J2EE, I got following two questions:
>
>1, In a typical application, there should be some global (even
>singleton) objects which are created on application startup code and
>stay there until the program exiting. In the idiom of J2EE, what kind
>of Beans act like this kind of global object? And, when and how these
>global beans should be created?
In the J2EE standard there is no definition for this kind of function.
So it might be implemented for a specific container as a manufacturer
specific extension. BTW there is usually no need to create instances
of any objects *before* the system starts normal operation. If you
need something to be prepared once to be used many times later until
shutdown - write a static class (with a Singleton pattern)
>2, I knew Beans have to be deployed onto the server before they come
>to be available, but those Beans quit often need some objects to
>complete its job, these objects may encapsulate a algorithem, may do
>some management task, but they typically dont have to exposed to
>client tire or web tire. I call these objects are intermediate
>objects. My question is, should this kind of objects need to be a EJB?
>My J2EE books seems only to mention three kinds of Beans,
>SessionBeans, EntityBeans and MessageBeans. But what do I do for those
>intermediate objects?
What objects do those beans you mention in this question need to
complete their jobs? Either it's any kind of persistant data (Entity
Beans), interaction data from user/other application
(stateless/stateful session bean), or what else did you think of?
Remember you can still create "normal Java" objects like e.g. DTOs
(data transfer objects).
|
| |
|
| |
 |
John C. Bollinger

|
Posted: 10/21/2003 2:17:00 AM |
Top |
java-programmer >> newbie: Global EJB and more ...
Steven Woody wrote:
> 1, In a typical application, there should be some global (even
> singleton) objects which are created on application startup code and
> stay there until the program exiting. In the idiom of J2EE, what kind
> of Beans act like this kind of global object? And, when and how these
> global beans should be created?
>
> 2, I knew Beans have to be deployed onto the server before they come
> to be available, but those Beans quit often need some objects to
> complete its job, these objects may encapsulate a algorithem, may do
> some management task, but they typically dont have to exposed to
> client tire or web tire. I call these objects are intermediate
> objects. My question is, should this kind of objects need to be a EJB?
> My J2EE books seems only to mention three kinds of Beans,
> SessionBeans, EntityBeans and MessageBeans. But what do I do for those
> intermediate objects?
Perhaps both questions are answered by the fact that EJBs may
instantiate and use objects of almost any class accessible to them.
Usage means invoking methods on such objects, and passing or accepting
them as method arguments, and returning them or accepting them as method
return values. EJBs are forbidden from performing actions that
interfere with their management by their container; such actions include
such things as starting threads and invoking System.exit().
John Bollinger
email***@***.com
|
| |
|
| |
 |
Steven Woody

|
Posted: 10/21/2003 9:22:00 AM |
Top |
java-programmer >> newbie: Global EJB and more ...
"John C. Bollinger" <email***@***.com> writes:
Thanks!
> Steven Woody wrote:
>> 1, In a typical application, there should be some global (even
>> singleton) objects which are created on application startup code and
>> stay there until the program exiting. In the idiom of J2EE, what kind
>> of Beans act like this kind of global object? And, when and how these
>> global beans should be created?
>> 2, I knew Beans have to be deployed onto the server before they come
>> to be available, but those Beans quit often need some objects to
>> complete its job, these objects may encapsulate a algorithem, may do
>> some management task, but they typically dont have to exposed to
>> client tire or web tire. I call these objects are intermediate
>> objects. My question is, should this kind of objects need to be a EJB?
>> My J2EE books seems only to mention three kinds of Beans,
>> SessionBeans, EntityBeans and MessageBeans. But what do I do for those
>> intermediate objects?
>
> Perhaps both questions are answered by the fact that EJBs may
> instantiate and use objects of almost any class accessible to
> them. Usage means invoking methods on such objects, and passing or
> accepting them as method arguments, and returning them or accepting
> them as method return values. EJBs are forbidden from performing
> actions that interfere with their management by their container; such
> actions include such things as starting threads and invoking
> System.exit().
>
>
> John Bollinger
> email***@***.com
>
--
%% (fortunes)
Q: How did you get into artificial intelligence?
A: Seemed logical -- I didn't have any real intelligence.
|
| |
|
| |
 |
| |
|