If your bean is that big then I would start to worry about the scope of the bean
If the bean is cr4eated in "page" scope than every JSP page is probably
creating a new bean (expensive in time). So it would be better
for you if the beans as stored in "session" scope.
You should also make your beans bind to the HttpSessionListener
so you clean up afterwards if you allocate resources like opening files
or conections to a database.
Finally multiple the size bean by the number of users at your web site.
Is it 1000, 10000, or 100 ? Then accumulate this size for each of the
beans that you potentially collect.
My advice would be see if you cache some information
in a EJB or database. Have many separate beans to perform
a certain task (eg. UserProfileBean, RegisterUserBean, EmployeeDetailBeans
, ProductRecordBean, OrderDetailBean, CustomerBean ). Create these
beans as need and then when they are not requirement remove the references
<%
OrderDetailBean ordbean = new OrderDetailBean( .... );
%>
// Do something with this bean
<%
if ( request.getParameter("submit order").getLength() > 0 ) {
...
ordBean.dispose(); // Have a dispose method in all beans!
ordBean = null; // Give the GC a chance to clean
}
%>
Hope this helps
--
Peter Pilgrim
G.O.A.T
"the Greatest Of All Time"
---------------------------------------- Message History
----------------------------------------
From: Kate Hocking <[EMAIL PROTECTED]>@java.sun.com> on 07/02/2001 13:26 ZE8
Please respond to "A mailing list for discussion about Sun Microsystem's Java
Servlet API Technology." <[EMAIL PROTECTED]>
DELEGATED - Sent by: "A mailing list for discussion about Sun Microsystem's Java
Servlet API Technology."@java.sun.com>
To: [EMAIL PROTECTED]
cc:
Subject: Re: Bean size?
okay then,
...a reference of it is instantiated on a few JSP pages that sets the
properties for that particular instance of the bean alive for that session.
My main worry is how big is too big?
80 properties? (with a matching get/set methods for each property)
500 properties?
When is a good "rule of thumb" to use multiple beans instead of one?
-----Original Message-----
From: George I Matkovits [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 7 February 2001 13:16
To: [EMAIL PROTECTED]
Subject: Re: Bean size?
It does not get passed around, meaning copied, only a reference to it,
unless it
gets serialized and saved.
Regards - George
Kate Hocking wrote:
> Hi All,
>
> when is a bean too big?
>
> how much info can it store?
>
> ...am I able to pass it around my application/jsp pages filling it up as I
> go?
> if the properties are left unfilled, is this hideously inefficient?
>
> regards,
> Kate
>
____________________________________________________________________________
> ________________________________________
>
> IMPORTANT: This email is intended only for the use of the individual or
> entity named above and may contain information that is confidential and
> privileged. The views expressed in this e-mail are those of the author and
> not of the company unless otherwise clearly indicated. When addressed to
> our clients, any information or quotes contained in this e-mail are
subject
> to the terms and conditions relevant at that time to the matter being
> addressed. If you are not the intended recipient and have received this
> e-mail in error, please notify us immediately by return email or telephone
> +61 8 93235555 and delete the e-mail and any attachments without using or
> disclosing the contents in any way. If you are not the intended recipient
> any dissemination, distribution or copying of this e-mail is strictly
> prohibited. Before opening or using attachments, check them for viruses
and
> defects. Our liability is limited to re-supplying any affected
attachments.
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
____________________________________________________________________________
________________________________________
IMPORTANT: This email is intended only for the use of the individual or
entity named above and may contain information that is confidential and
privileged. The views expressed in this e-mail are those of the author and
not of the company unless otherwise clearly indicated. When addressed to
our clients, any information or quotes contained in this e-mail are subject
to the terms and conditions relevant at that time to the matter being
addressed. If you are not the intended recipient and have received this
e-mail in error, please notify us immediately by return email or telephone
+61 8 93235555 and delete the e-mail and any attachments without using or
disclosing the contents in any way. If you are not the intended recipient
any dissemination, distribution or copying of this e-mail is strictly
prohibited. Before opening or using attachments, check them for viruses and
defects. Our liability is limited to re-supplying any affected attachments.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html