inheritance relationship between the two roles into the aggregation relationship, the strong association between them is changed to weak association;(P185)Bridging in bridge mode is one-way, that is, the object that can only be an abstract part to use the concrete realization part of the object, but not in turn;(P194)from a more essential point of view, basically as long as the Java program for the abstract writing, can be regarded as the application
inheritance relationship between the two roles into the aggregation relationship, the strong association between them is changed to weak association;(P185)Bridging in bridge mode is one-way, that is, the object that can only be an abstract part to use the concrete realization part of the object, but not in turn;(P194)From a more essential point of view, basically as long as the Java program for the abstract writing, can be regarded as the application
modified the class it belongs to.Strategy: Define a series of algorithms, encapsulate them one by one, and make them interchangeable with each other. This mode allows the algorithm to be changed independently of the customer using it.Templatemethod: Defines the skeleton of an algorithm in an operation, and delays some steps into subclasses. Templatemethod allows subclasses to redefine some specific steps of the algorithm without altering the structure of an algorithm.Visitor: Represents an oper
The essentials and patterns of software design (version 2nd) is the book on software design and design patterns published by Zhang Yi of garden in April this year. I got it in late May and read a chapter every night, after reading
experience reach a certain level, and it also means to summarize a lot of good design experience, however, it may not be the case that "no teacher can do anything", or you can say that, on the basis of level and experience, it is time for the system to learn the "mode, it is helpful to learn the experts' summary and verify your own shortcomings.
This series of design p
Responsibility Pattern)Command Pattern)Interpreter mode (Interpreter Pattern)Iterator Pattern)Mediator Pattern)Memory memorandum mode (Memento Pattern)Observer Pattern)State Pattern)Strategy Pattern)Template Method Pattern)Visitor Pattern)We recommend that you have a good book: "software tips: the point of design patterns", in which 23 examples of
23 design patterns (22) java state patterns, 23 Design Patterns
I. Overview
When an object in the system has multiple states, these States can be converted, and the state mode can be used for different states of the object. The St
In the previous Java 23, you learned about the singleton mode and Factory mode of design mode. Here, the design pattern is introducedPrinciple of object-oriented thought designIn the actual development, we want to understand the object-oriented thinking more deeply, we must be familiar with the design principles of the
patterns, and the book has been recognized as a cornerstone in the field of design patterns.Some basic principles of object-oriented1. For abstract principlesWhen designing a class, do not let the class target a specific class, but instead target an abstract class or interface.For example: Define a cylinder with a triangular bottom face2. Open-Close principleThe
Illustration: Java 23 design patterns Note 1, Java 23 Design PatternsIterator pattern 1.1 Iterator Pattern
The element code in the array arr is displayed in Java as follows:
1 for (int I = 0; I
Many elements are saved in the a
Working for n years, suddenly wanted to comb the knowledge about design and architecture. I would like to ask if there is any good book or material in this respect, more about the actual work, worthy of recommendation of excellent practice. Originally felt like "Enterprise Application Architecture Model" good, just a bit of translation is a little hehe, look very tired.
Reply content:
Working for n yea
StaticSingleton getinstance () {if(INSTANCE = =NULL) {INSTANCE=NewSingleton (); } returnINSTANCE;//get instantiated Object } Public voidprint () {System.out.print ("Hello word"); }} Public classtest{ Public Static voidMain (String args[]) {Singleton s= Singleton.getinstance ();//regardless of how many times the getinstance () method is called, the resulting instantiation object is the sameS.print (); }}Multiple design
Some time ago, I finally got my long-awaited book "Zen of design patterns", but for work reasons, there is no time to calm down and savor the Zen words from my work practices. I put this book in front of my bed. Whenever I go to bed, I will flip it over. I have read some books on d
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.