Designing Java beans
I need to develop an application with following
3)Javabeans (not EJB)
using Model, View, controller paradigm.
I have several questions on my mind regarding the design of the application
1) Should java beans to be used only for Visual components ?
2) where do i have to put my core business data ? Should i have them as a
attributes for a bean ?
If you can give me some sort of guidelines on the above lines, or refer me
to a web site that talks about this , it will be of great help to me
Re: Designing Java beans
Ramprasad <firstname.lastname@example.org> wrote:
>1) Should java beans to be used only for Visual components ?
Although much of the bean specification deals with how to manipulate
beans in a visual editor, they can be used in many other ways.
Really, beans can be used any time you can model some object or logic
as a 'black box' with well-defined inputs and outputs.
>2) where do i have to put my core business data ? Should i have them as a
>attributes for a bean ?
Absolutely! Let me give you a real-world example. The first thing a
new user at CapitalThinking (www.capitalthinking.com) will typically
do is describe a property for which they would like to obtain a
mortgage, then they will describe the mortgage terms they would like,
and we show them a list of lenders that match their criteria. We have
a 'property' bean with get and set methods for things like the asset
value and address. We have a bean for the loan terms. We also have a
bean that actually performs the search, all the complex search logic
is hidden in this bean, the application just needs to call
getMatches() to obtain the results.
>If you can give me some sort of guidelines on the above lines, or refer me
>to a web site that talks about this , it will be of great help to me
In broad terms:
* Beans contain the business logic (the model)
* JSPs display results from beans, and generate the forms that populate
the beans (the view)
* Servlets handle the interaction between the user and the view, such
as authentication, setting up any beans that get created without
direct user intervention, and so on (the controller).
There is an article that discusses design patterns for enterprise
This is more focused on J2EE, including EJB, but most of it applies
equally well to regular Java beans.
Last Post: 05-13-2005, 06:46 AM
By Mike Tsakiris in forum .NET
Last Post: 10-04-2002, 05:32 PM
By JJ in forum Enterprise
Last Post: 07-06-2000, 04:50 AM
By Texas Ranger in forum Java
Last Post: 06-28-2000, 11:17 AM
Last Post: 04-08-2000, 08:13 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center