?
Solved

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

Posted on 2004-11-18
11
Medium Priority
?
202 Views
Last Modified: 2010-03-31
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?

0
Comment
Question by:TheDownsizer
  • 5
  • 4
  • 2
11 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 12618109
0
 

Author Comment

by:TheDownsizer
ID: 12618132
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.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 90 total points
ID: 12618173
Actually non-gui beans are the same, but simpler. As for state, if you mean by that persistence, there's a chapter devoted to that, but you may wish to have another entity implement your persistence in a web application
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:TheDownsizer
ID: 12618276
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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12618305
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
0
 

Author Comment

by:TheDownsizer
ID: 12618362
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.
0
 
LVL 92

Assisted Solution

by:objects
objects earned 60 total points
ID: 12620250
Why would you suggest EJB's for this?? I don't see any need.
0
 
LVL 92

Expert Comment

by:objects
ID: 12620256
using EJB is only going to greatly overcomplicate your application for no apparent gain.
0
 

Author Comment

by:TheDownsizer
ID: 12710885
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.


0
 

Author Comment

by:TheDownsizer
ID: 12710915
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.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12711016
:-)

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
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question