Link to home
Start Free TrialLog in
Avatar of TheDownsizer
TheDownsizer

asked on

adapting a set of API's to be an invisibe bean - ideas or examples

Hi,

I have a set of API's, (typically called in a particular sequence) which is used to carry on a text based dialog.

Example of some of the API would be something like so:
start(...)
askQuestion(...)
answerQuestion(...)
stop(...)
etc...

To get an idea of the program, think of it as just a command line app that allows a user to be asked something, then able to answer it, over and over again until they are done. The app may eventually be used in server environments with JSP, able to handle multiple different conversations simultaneously.

I am new to the concept of beans. The challenge is to be able to adapt such an interface to use getter and setter methods and properties.

Anyone out there have any suggestions or know of any great tutorials on the web for this sort of thing?

Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Avatar of TheDownsizer
TheDownsizer

ASKER

I read that tutorial before. It makes things clear for GUI beans, which are relatively simple. It doesn't address invisible beans, nor applications with state-like behavior.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I wish that were true, but in my case they aren't simpler (or doesn't seem to be) or I would have just gone ahead and done it without posting a question here. Gui beans seem relatively obvious how to create because they have properties that are apparent, which also lend themselves to creating getter and setter methods easily. I gave an example above, which does not have that convenience. Either that, or I just haven't thought it through enough yet.
It would seem that in your case you have more 'verbs' than 'nouns', so an EJB may be a better fit in your web app
Thanks for the pointer. I'm not familiar at all with EJB. I'll look into it a get back with a response when I can.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
using EJB is only going to greatly overcomplicate your application for no apparent gain.
It was much simpler than I thought. Didn't realize that my api's did not require any changing, until a little more reading. Just made the class Serializable, put it in the classpath, ran a webserver and accessed it through JSP. Eventually I may make it EJB for the RMI functionality.


Thanks.. I thought the invisible beans were gonna require all sorts of interfaces and convoluted changes to my api.. I see what you meant CEHJ and you too Objects.
:-)

EJBs are not necessary. I only suggested it since normal simple beans have properties more than methods, but again, that doesn't have to be the case