design patterns elements of reusable object oriented software
design patterns elements of reusable object oriented software
Discover design patterns elements of reusable object oriented software, include the articles, news, trends, analysis and practical advice about design patterns elements of reusable object oriented software on alibabacloud.com
static method can be executed by a class without having to instantiate it as an object.The role of the----> method is to access and change the properties of an object, sometimes the method simply encapsulates the algorithm, and executing the method does not alter the object's properties, and in object-oriented, the principle is that an object's properties should
clearly described in the article. I will do my best to do this here, but now you are ready to browse the following design patterns (Principles)DRY-Don't repeat yourself
Our first object-oriented design principle is: DRY. From the name, we can see that DRY (don't repeat your
Http://blog.sina.com.cn/s/blog_6d2890600101cwih.htmlThree data are missing a word, namely: "Programming", "Architecture" and "development" (or "Software Engineering"). At the same time, it is not "facing" components but "based on" components.
Object-oriented Programming (Object-oreinted programming) is a programming paradigm. Refers to the way in which clas
the design pattern, the code is all design patterns, and the most important, the core of the object, are submerged in various patterns. So, there are three main elements in the entire object
access methods defined in the public interface. A large number of access methods means that the relevant data and behavior are not centrally stored.
(15) Be cautious about classes that contain too many non-communicating behaviors.
Another manifestation of this problem is that many get and set functions are created in the public interface of the class in your application.
(16) In an application that is composed of an object-
access methods defined in the public interface. A large number of access methods means that the relevant data and behavior are not centrally stored.
(15) Be cautious about classes that contain too many non-communicating behaviors.
Another manifestation of this problem is that many get and set functions are created in the public interface of the class in your application.
(16) In an application that is composed of an object-
Object-oriented(Object Oriented, OO) is currently the focus of the computer industry, it is the mainstream software development methods in 1990s. Object-oriented concepts and applications have gone beyond programming and software
association between people and Student
student.prototype = object.create (people.prototype);
var human = new People ("Joy");
Human.sayyourself ()//
var studenta = new Student ("Cindy", "Junior");
Studenta.sayyourself ()//
Such code seems to solve the problem of inheritance, but it is very cumbersome, the following is my recommendation for the delegate-oriented, and object-related
Most of the time, we understand that object-oriented means adding methods to data, encapsulation means hiding data, but this is not comprehensive. For example, a cat has a head, four legs, and a tail. Although there is no error, it is not comprehensive. In terms of appearance, this is indeed the case for Object-Oriented
Seven principles: Open and close principle, Richter substitution principle, dependency reversal principle, synthesis/aggregation multiplexing principle, Dimitri rule, interface isolation principle, single duty principle.The open and closed principle is the cornerstone of object-oriented reusable. The other six principles are instruments and tools.Details of the r
coupling (Low coupling)Loosely coupled as a principle of evaluation system design, the responsibility lies in:
Reduce dependencies between classes and classes
Change the impact of a class to other classes to minimize
Higher reusability
Polymorphic (polymorphism)In an inherited system, a different invocation is produced at run time using the same design-time definitionProtected changes
Rule
1
: Give priority to (object) combination, rather than (class) Inheritance
[Favor composition over inheritance]
Combination
N(Object) is a combinationCombinationTo obtain the reuse method of new functions.
NDelegates a feature to a combined object to obtain the new feature.
NSometimes it is also called "aggregation "(Aggregation) Or "inclusive
[Favor composition over inheritance]
Combination
1. (object) combination is a method of reusing new functions by creating an object that combines other objects.
2. delegate the function to a combined object to obtain the new function.
3. Sometimes it is called "aggregation" or "inment", although some authors give special meanings to these terms
4. For example:
A
Just like the location of Newton's three major laws in classical mechanics, the open-closed principle is the cornerstone of object-oriented reusable design (Object Oriented Design or OO
patterns (principles)Dry–don ' t Repeat yourselfOur first object-oriented design principle is: DRY, from the name you can see that DRY (don ' t repeat yourself) means not to write duplicate code, but to abstract it into reusable blocks of code. If you have two or more block
patterns (principles).Dry–don ' t Repeat yourselfOur first object-oriented design principle is: DRY, from the name you can see that DRY (don ' t repeat yourself) means not to write duplicate code, but to abstract it into reusable blocks of code. If you have two or more bloc
Object-oriented design principles are at the heart of oops programming, but most of the Java programmers I've seen are enthusiastic about design patterns like Singleton (singleton), Decorator (adorner), OBSERVER (Observer), Instead of focusing enough attention on learning
Object-oriented design is divided into two stages, namely high-rise design and low-level design
High-level design
The overall model of development software for the development of the system in the high-rise
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.