Java interview-software engineering and design model

Source: Internet
Author: User

 

1. UML


Standard Modeling Language (UML. Use case diagram, static diagram (including class diagram, object diagram, and package diagram), behavior diagram, and interaction diagram (sequence diagram, cooperation diagram) to implement the diagram.

2.
Software Development

3. What are the common design patterns of J2EE? Describe the factory model.

A total of 23 types are divided into three categories: Creation type, structural type, and Behavior Type

I only remember 6 and 7 of them, which are commonly used:

Creation type (factory, factory method, abstract factory, Singleton)

Structural (packaging, adapter, combination, proxy)

Behavior (Observer, template, Policy)

Then, let's talk about your understanding of the mode you are familiar.

 

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 (decoration mode ),
Flyweight (meta mode), proxy (proxy mode ),

Command (command mode), Interpreter (Interpreter mode ),
Visitor (visitor mode ),

Iterator (iteration submode), mediator (Mediation mode ),
Memento (memorandum mode ),

Observer (Observer mode), State (State mode ),
Strategy (Strategy 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.

4. What design patterns are used in development? In what scenarios?

Each mode describes a problem that is constantly emerging in our environment, and then describes the core of the solution to 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.

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.