Seven major design principles:1. Single Duty principle: one class is responsible for a duty.2, the Richter replacement principle: Subclasses can extend the function of the parent class, but cannot change the original function of the parent class.3, dependency inversion principle: The high-level module should not rely on the lower layer module, both should rely on its abstraction; abstraction should not depend on detail; detail should depend on abstrac
Since the advent of Java-EE, it has greatly simplified the enterprise-level development under the java-based. But as Java EE becomes more and more widely used in various fields, developers are becoming aware of the need for a way to standardize the application's development process by standardizing the architectural la
What is the design pattern? In the process of Learning Object-oriented, we will always come into contact with the pattern from time to time! As our predecessors have mentioned, the design model is a summary of people's experience! In software development, we always encounter some reusable components,CodeSo that we can focus on Object-Oriented Reusable Technology. With the development of Reusable Technology,
Classification of plant design and design patterns: The factory model is divided into three categories in Java and mode:1) Simple Factory mode (simply Factory): not conducive to the production of products;2) Factory method mode (Factory): Also known as the polymorphism plant;3) Abstract Factory mode (abstract Factory):
Bookstore Management SystemThe bookstore management system can be said to be a more classic example of design patterns and design ideas.This series will be divided into several sections on this transmission management system.Bookstore management system will be divided into: Users, books, purchase, sales and inventory of five modules, in addition to public package
Design patterns are specific solution patterns (routines) that can be reused for specific problems in a specific situation that is constantly emerging. According to the three categories of creation, structure and behavior, this paper summarizes the main points of use of 24 kinds of design
Design the samples in Java.
Build Status:
Introduction
Design patterns are formalized best practices and programmer can use to solve common problems when designing a appli cation or system.
Design patterns can speed up the devel
privatized, other programs can no longer create the class object;2, create an object of this class in a class;3, define a method that returns the object so that other programs can get this type of object by means of the method. (Effect: controllable).How to describe things and how to describe them.Add the above three steps when you need to guarantee that the object of the thing is unique in memory.a hungry man: A single class enters the object, it has already created the object.Lazy Type: The s
this class in the class (the final keyword, etc. have learned, is the ultimate meaning, hehe)Private Finla Static single =new single ();Provides a public access method that can be obtained to the class objectpublic static single getinstance () {return single;}The lazy type of the single case design patternobject is initialized when the method is called, or deferred loading of the objectSingle class into memory, the object does not exist, only the obj
enthusiasts, learn the design model, do a good software engineer!Enterprise-level project combat (with source) address :http://zz563143188.iteye.com/blog/182516823 Modes Java implementation of the source codeHttp://pan.baidu.com/share/link?shareid=372668uk=4076915866#dir/path=%2F%E5%AD%A6%E4%B9%A0%E6%96%87%E4%BB %b6I. Classification of
}Singletonlazy The object is not created immediately after it is loaded into the method area, it is not created until the GetInstance method is called. This way can save memory space, but there is also a thread security problem, when thread a execution to the judgment object is null, when thread B gets execution, thread B determines that the object is null, then thread a regain execution, create the object, thread B resumes, continue to create the object. Modify the code as follows, using a sync
Java Singleton design pattern, there are many ways to implement, the following describes some of the more famous implementation methods
A Hungry man typeThis design pattern is simple, and there is no multi-threading security problem, which is generally used in practical development.
Class Hungerydemo{private Hungerydemo () {}private static final Hun
pool overflow, if the instantiated object is not exploited for a long time,The system is considered garbage and is recycled by GC resulting in loss of object state Lazy mode: A Hungry man mode:Dual Lock mode: Summarize: 1, lazy mode features: Thread insecure, load classes faster, run time to get objects slower,2, a Hungry man mode features: Thread safety, load class is slow, run time to get objects faster3, double lock mode: Thread-safe, load class faster, run-time to get objects at
: Interface high cohesion is internally highly dependent and isolated as much as possible. That is, the method of internal declaration of an interface is related to a sub-module, and is required by this submodule.
Interface design is limited: If you fully follow the principle of interface separation, there will be a problem, that is, the design of the interface will be less and less, so that the number
(Structural Patterns), and the Behavioral pattern (behavioral Patterns). Of course, there is another type of design pattern: the Java EE design pattern.
Serial Number
Patterns Descriptions
include
Design pattern (Patterns)
--the foundation of reusable object-oriented software
Design patterns are a set of repeated use, most people know, through the classification of purpose, code design experience Summary. Design
Opening and closing principle OCP (Open for extension,closed for modification). The core idea of open and close principle is that an object is opened to expansion and closed to modification.
In fact, the opening and closing principle means that changes to the class are made by adding code rather than altering the existing code. In other words, once the software developer writes out the code that can be run, it should not change it, but to ensure that it can continue to run, how to do this? Th
Designing the design mode of Banqiao is the earliest introduction of the system in the domestic media (including books and websites). This series introduces pure for free dissemination (reprint this website article, please keep the author and the website), as far as possible concise, is easy to understand, but inevitably has the omission to ask the letter or the forum discussion, unceasingly consummates.
The real mastery of
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.