JavaBeans: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
m Dating maintenance tags: {{Fact}}
NotAG on AWB (talk | contribs)
replace {{manual}} with {{how-to}} per TfD
 
(4 intermediate revisions by 4 users not shown)
Line 1:
{{Short description|Computing technology developer by Sun Microsystems}}
{{Distinguish|Enterprise JavaBeans}}
{{multiple issues|
{{refimprovemore citations needed|date=June 2016}}
{{manualhow-to|date=October 2012}}
}}
 
In computing based on the [[Java (programming language)|Java]] Platform, '''JavaBeans''' is a technology developed by [[Sun Microsystems]] and released in 1996, as part of [[Java Development Kit|JDK]] 1.1.
 
The 'beans' of JavaBeans are classes that encapsulate one or more [[Object (computer science)|objects]] into a single standardized object (the bean). This standardization allows the beans to be handled in a more generic fashion, allowing easier [[code reuse]] and [[Type introspection|introspection]]. This in turn allows the beans to be treated as [[Component-based software engineering|software components]], and to be manipulated visually by [[Integrated development environment|editors and IDEs]] without needing any initial configuration, or to know any internal implementation details.
 
As part of the standardization, all beans must be [[Serialization|serializable]], have a [[nullary constructor|zero-argument constructor]], and allow access to properties using [[Mutator method|getter and setter methods]].
Line 23 ⟶ 24:
:Persistence is the ability to save the current state of a Bean, including the values of a Bean's properties and instance variables, to nonvolatile storage and to retrieve them at a later time.
;Methods
:A Bean should use [[Mutator_methodMutator method#Java_exampleJava example|accessor methods]] to [[Encapsulation_Encapsulation (computer_programmingcomputer programming)|encapsulate]] the properties. A Bean can provide other methods for business logic not related to the access to the properties.
 
== Advantages ==
 
* The properties, events, and methods of a bean can be exposed to another application.
* A bean may register to receive events from other objects and can generate events that are sent to those other objects. {{factcitation needed|date=January 2023}}
* Auxiliary software can be provided to help configure a bean. {{factcitation needed|date=January 2023}}
*The configuration settings of a bean can be saved to persistent storage and restored. {{factcitation needed|date=January 2023}}
 
== Disadvantages ==
Line 116 ⟶ 117:
/**
* Getter for property "deceased"
* Different syntax for a boolean field (is v.s.vs get)
*/
public boolean isDeceased() {
Line 180 ⟶ 181:
</html>
</syntaxhighlight>
 
== See also ==
* [[Software package (disambiguation)|Software packaging]]
 
==References==