Some concepts and techniques often encountered in Java web development

Source: Internet
Author: User
Tags event listener


JavaBean is actually an entity class, JavaBean has the following features: 1, the class is the only one, 2, the member variable is private, 3, each member variable provides a pair of setter and getter Method 4, there are no parameters of the construction method.

JavaBean is a reusable component written in the Java language. To write JavaBean, the class must be concrete and public, and have a parameterless constructor. JavaBean exposes the member properties to the internal domain by providing a public method that conforms to the consistent design pattern. It is well known that property names conform to this pattern, and other Java classes can discover and manipulate the properties of these javabean through their own mechanisms.

A javabean consists of 3 parts:

   (1) attributes (properties)
JavaBean provides a high-level attribute concept, which is not only a property in the traditional object-oriented concept in JavaBean, but also supported by API for property reading and property writing. Property values can be made by invoking the appropriate Bean method. For example, a bean might have a name attribute whose value might need to be called by the string GetName () method, while writing the property value might require a method called void SetName (String str).
Each JavaBean property should typically follow a simple method naming rule so that the application constructor tool and end user can find the properties provided by JavaBean and then query or modify the property values to manipulate the bean. JavaBean can also respond to changes in property values in a timely manner. For example, a javabean that displays the current time, if the time zone property of the clock is changed, the clock is redrawn immediately, showing the time of the currently specified time zone.
   (2) methods (method)
The method in JavaBean is the usual Java method, which can be called from other components or in a scripting environment. By default, all of the bean's public methods can be called externally, but the bean generally only leads to a subset of its public methods.
Since JavaBean itself is a Java object, the method of invoking this object is the only way to interact with it. JavaBean strictly adheres to the object-oriented class design logic and does not allow the outside world to access any of its fields (there is no public field). In this way, the method call is the only way to touch the bean.
However, unlike normal classes, the low-level mechanism of invoking instance methods is not the primary way for some beans to manipulate and use beans. Exposing bean methods is reduced to secondary status in bean operations because two advanced bean attributes-Properties and events-are a better way to interact with beans.
The bean can therefore provide the public method to be used by the customer, but it should be recognized that the bean designer wants to see that most of the bean's functionality is reflected in the properties and events, rather than in the human invocation and the individual methods.
   (3) events (event)
The primary way beans exchange information with other software components is to send and receive events. We can consider the Bean's event support function as an input and output pin in an integrated circuit: The engineer connects the pins together to form the system, allowing the components to communicate. Some pins are for input and some are for output, which is equivalent to sending events and receiving events in the event model.
Events provide a way for the JavaBean component to send notifications to other components. In the AWT event model, an event source can register an event listener object. When the event source detects that an event has occurred, it invokes an appropriate event-handling method in the event listener object to handle the event.
This shows that JavaBean is indeed a common Java object, but it follows some special conventions.


In layman's terms, EJB is: "The class of software that you write that needs to be executed is not put on the client software, but it is put into a package on a server." Yes! EJB is to put those "classes" on a server, in the form of C/S software client to the "class" on the server call.

EJB is the Sun's Java EE server-side component model, and the design goal and core application is to deploy distributed applications. With the advantages of Java cross-platform, distributed systems deployed with EJB technology can be limited to specific platforms. EJB (Enterprise JavaBean) is part of the Java EE, which defines a standard for developing component-based enterprise multi-application applications. Features include network service support and core development tools (SDKs). In Java EE, Enterprise Java Beans (EJB) is called Java Business Bean, which is the core code of the kernel, namely the session bean, the entity bean Bean) and the message-driven bean (Messagedriven bean).

3.Java Common Program Deployment Server

IBM Websphere,bea Weblogic,tomcat,jboss,resin,jetty

Some concepts and techniques often encountered in Java web development

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.