• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

delegate options

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

We currently have a standalone java application. We have to package the same as an EAR and submit it to the client. The client will use a web service to invoke this application.
The standalone app has a main class which includes the method which orchestrates the entire application run. We make this main class implement an interface so external clients can use the interface as a handle.

Now the client wants a delegate to this application and does not want its web service directly using our application's exposed interface.
Can this delegate be just a simple java class or should we go for something like ejb for a mere delegate.

Do post your thoughts on the same.

Mohit
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel the decision depends on how you want to release your application.
If it is a library i.e. runs along with the web service code, then no need to have a remote interface to it(via ejb or plain rmi)
If it is a standalone application, then you need to provide a remote interface for the delegate.
 
Mohit Sinha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes the application in its current form is just a standalone application and to be deployed in an application server.
In the delegate I have to make a decision whether to call the standalone app via direct invocation(synchronous) depending on the input received or route it to the batch manager which invokes the standalone app as a batch job (asynchronous).

Does it have to be a remote interface. I mean can it be something like local interface (something like EJB local interface or any other viable alternative).


-------------------------------------
I feel the decision depends on how you want to release your application.
If it is a library i.e. runs along with the web service code, then no need to have a remote interface to it(via ejb or plain rmi)
If it is a standalone application, then you need to provide a remote interface for the delegate.
------------------------------------
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mohit:Yes the application in its current form is just a standalone application and to be deployed in an application server.



Actually, what i meant by a standalone application(also what people generally mean by standalone) was that the application runs in its own separate JVM. Which does not look so in your case.

Mohit: In the delegate I have to make a decision whether to call the standalone app via direct invocation(synchronous) depending on the input received or route it to the batch manager which invokes the standalone app as a batch job (asynchronous).


Ok, but that does not change the form in which the delegate is exposed to the api clients.

Mohit:
Does it have to be a remote interface. I mean can it be something like local interface (something like EJB local interface or any other viable alternative).


Providing a remote interface (ejb or plain old RMI) facilitates a client to call the api from a different JVM from the one running your delegate.

Okie, so, if you are deploying your application in an application server, then it is better to make the delegate as ejb with a local and remote interface.
That gives you a flexibility to scale your application i.e. choose to deploy the app in the same application server or a different one. Also, it will give you the facilities of transaction (more so if you want to club two api calls into one in the delegate, etc.), security and failover.
So, i would vote for the delegate as an ejb.
 
Mohit Sinha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Nitesh.

Those responses were indeed helpful
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the Session Facade design pattern for guidance on how to implement the delegate API.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic