|
-
Designing Java beans
Hi,
I need to develop an application with following
1)JSP
2)Servlets
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
Rgds
-
Re: Designing Java beans
Ramprasad <ssrik@yahoo.com> 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
applications at
http://developer.java.sun.com/develo...DesignEntApps/
This is more focused on J2EE, including EJB, but most of it applies
equally well to regular Java beans.
- Larne
Similar Threads
-
Replies: 1
Last Post: 05-13-2005, 06:46 AM
-
By Mike Tsakiris in forum .NET
Replies: 11
Last Post: 10-04-2002, 05:32 PM
-
By JJ in forum Enterprise
Replies: 1
Last Post: 07-06-2000, 04:50 AM
-
By Texas Ranger in forum Java
Replies: 2
Last Post: 06-28-2000, 11:17 AM
-
Replies: 2
Last Post: 04-08-2000, 08:13 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks