JavaBean fundamental...some very basic question
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vaiv_B
Posted On:   Wednesday, November 3, 2004 09:19 PM

javabean fundamention beginner question hi i am a new programmer to Java Beans and Java Server Pages/Servlets technology. can anyone tell me what is the aim of having Java beans...? i mean.. look, what i think is JavaBeans act as a temporary database of all the variables (which they call as properties) in a session...am i correct??? they act as the temporary database for an ongoing session...and help to store variables...which can be accessed from anywhere in the session...but then this could be done through session.setAttribute and session.getAttribute... if this is so..why do we need Javabeans? Is it becoz we can have the manipulation functions on the variables which sessio.get/setAttribute cannot do.    More>>
javabean fundamention beginner question

hi i am a new programmer to Java Beans and Java Server Pages/Servlets technology.

can anyone tell me what is the aim of having Java beans...? i mean.. look, what i think is JavaBeans act as a temporary database of all the variables (which they call as properties) in a session...am i correct???

they act as the temporary database for an ongoing session...and help to store variables...which can be accessed from anywhere in the session...but then this could be done through session.setAttribute and session.getAttribute... if this is so..why do we need Javabeans?

Is it becoz we can have the manipulation functions on the variables which sessio.get/setAttribute cannot do.

also i am thinking that javabeans act as the temporary storage of the variables in a session until we commit them in a database or use them in the session. am i correct.

look i know i pose as a fool when i ask these stupid questions from u all...but this is how i will know the facts correctly and will build a solid foundation. please help me in getting the basics correct.


with thanks...    <<Less

Re: JavaBean fundamental...some very basic question

Posted By:   Anup_Jani  
Posted On:   Thursday, November 18, 2004 06:42 PM

Java Bean reduces coding effort:
session.setAttribute & session.getAttribute stores & retrieves attributes in session. True. Would you prefer calling them for 10 times if 10 items to be stored in session? Or would you prefer bundling up those 10 related items in one bean & just call session.setAtt../getAtt.. for once for that bean?


Java Bean is re-usable component:
For example, you want to process an array of application forms filled up by college students. Each application form contains student personal detail & subjects to chose. You might prefer creating 3 beans called StudentBean & SubjectBean. Third bean is ApplicationBean that has 2 above beans as attributes. Thus data population, processing etc... becomes manageable.


Java Bean keeps data intact:
Easy to pass as parameters to next method.


Java Bean keeps data well-structured:
Which you might find convinient while mapping with XML, Data objects, DB tables etc...


Java Beans helps in maintenance:
In future your JSP screen changes a little bit. Let's say, few attributes added. You know that your Java Bean for that screen will also have respective addition. Easy to maintain.


Java Beans are serializable:


Java Beans gave birth to EJB:
Java Beans are evolved as re-usable components that are coarse grained & used in enterprise applications which are now known as Enterprise Java Beans.

Re: JavaBean fundamental...some very basic question

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, November 4, 2004 09:04 PM

Look at how frameworks (Spring, Hibernate etc.) use java bean properties to automatically discover whether something can be get/set.
About | Sitemap | Contact