Questions and answers when applying for a Java test (Part 10)

Source: Internet
Author: User

Design Patterns
129 what design patterns are used in development? In what scenarios?
A: each mode describes a problem that is constantly emerging in our environment, and then describes the core solution of the problem. In this way, you can use existing solutions countless times without repeating the same work. The MVC design mode is mainly used. Used to develop JSP/Servlet or J2EE applications. Simple factory mode.

130. How many common j2ee models do you know or have heard? And some opinions on the Design Model
A: Session Facade Pattern: Use SessionBean to access EntityBean.
Message Facade Pattern: asynchronous call
EJB Command Pattern: replace SessionBean with Command JavaBeans for Lightweight Access
Data Transfer Object Factory: Using DTO Factory to simplify EntityBean Data provision features
Generic Attribute Access: the AttibuteAccess interface simplifies EntityBean data provision features
Business Interface: Use Remote (local) interfaces and Bean classes to implement the same Interface and standardize Business logic consistency
The design of the EJB architecture directly affects the system performance, scalability, maintainability, component reusability, and development efficiency. The more complex the project, the larger the project team, the more important the design is.

131 what are the common design patterns of j2ee? Describe the factory model.
A: There are 23 Design Patterns in Java:
Factory (Factory mode), Builder (construction mode), Factory Method (Factory Method mode ),
Prototype (original model mode), Singleton (Singleton mode), Facade (Facade mode ),
Adapter (Adapter mode), Bridge (Bridge Mode), Composite (merging mode ),
Decorator, Flyweight, Proxy ),
Command (Command mode), Interpreter (Interpreter mode), Visitor (Visitor mode ),
Iterator, Mediator, Memento ),
Observer (Observer mode), State (State mode), Strategy (Policy mode ),
Template Method (Template Method mode), Chain Of Responsibleity (responsibility Chain mode)
Factory mode: The factory mode is a frequently used mode. Classes implemented based on the factory mode can generate instances of a class in a group based on the provided data, generally, this group of classes has a common abstract parent class that implements the same method, but these methods perform different operations on different data. First, you need to define a base class. The subclass of this class implements the methods in the base class through different methods. Define a factory class. The factory class can generate different subclass instances according to the conditions. After obtaining the subclass instance, developers can call the methods in the base class without having to consider which subclass instance is returned.

132 UML
A: Standard Modeling Language (UML. Use case diagram, static diagram (including class diagram, object diagram, and package diagram), behavior diagram, InterAction diagram (sequence diagram, cooperation diagram), implementation diagram, UML aspect

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: info-contact@alibabacloud.com 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.