development. Secondly. For the enterprise, the application design mode can make the SOFTWARE product quality is guaranteed, the system stability is greatly improved, for the enterprise to create a lot of other profit rising space; Finally, individuals and businesses are constantly growing, nature will create a lot of other social value. Make a lot of other contributions to society. Therefore, we need the design pattern, the enterprise needs the design pattern, the society also needs the design
the same external interface. This means that although specific actions are different for different objects, they can be called in the same way through a common class.Five basic PrinciplesSingle Duty principle SRP (Responsibility Principle)Refers to the function of a class to be single, not all-encompassing. Like a person, the distribution of work can not be too much, otherwise busy all the way, but the efficiency is not high up.Open closure principle
Separation of concerns (separation of CONCERNS,SOC) is the ability to identify, encapsulate, and manipulate concerns by "identifying, encapsulating, and manipulating" the software components associated with only "specific concepts, goals, and concerns". is a principle of dealing with complexity. Because the combination of concerns leads to a significant increase in complexity, it is possible to separate the different points of concern and deal with each other as a principle of dealing with compl
In the near period of time feel nothing to do, always want to sleep, not because there is no thing to do, nor is there too much to do. A few days later, I suddenly realized that it was a mess of my time. Night sleep time from the original 23:00-6:30 into a 0:00/1:00-8:00, although the time to sleep did not change, but habits changed, the body of various discomfort also manifested, such as: mouth ulcers, acne, headache and so on. The next few days have been very focused on sleeping time. This adj
Reference: Http://baike.baidu.com/link?url=Sr0U52SUMhFl0jdpQQM0BoER5P1gHx8jEul4Rfg518v9SLp0qg4C2c1Twb5KyYTh6B4Ght9m_ AvlestiuhploaThe agile development takes the user's demand evolution as the core, uses the iterative, the gradual step method carries on the software development. In agile development, software projects are cut into multiple sub-projects in the early stages of construction, and the results of each sub-project are tested for visual, integrated, and operational use features. In othe
Dynamic SQL statements:1.foreach2.where if3. Inclube-sql4.set if5.trim if6. Choose whenClass-To-Class relationships:Inheritance: Subclass Inherits Parent classImplementation: Implementing Class-to-interface implementationsAssociations: Relationships between classes are owned byAggregation: The interpretation of combinatorial similarity reference combinationsCombination: The relationship between the whole and the part is not present after the aggregation is separated from the whole.Dependency: T
software entity has to other entities, the better, or if two classes do not have to communicate directly with each other, then these two classes should not have a direct interaction, but indirectly by introducing a third party.
★★★☆☆
One: Single Responsibility Principle:Single Responsibility PRINCIPLE,SRP definition: All objects should have a sole responsibility, and all of the services it provides are only around this responsibility. (
(){};} 这一种实现使用枚举来实现,能避免多线程同步问题,还能防止反序列化重复创建对象的问题,但由于枚举是在jdk1.5才加入的新特性,因此目前还很少看到有人在实际项目中使用。The fifth implementation:public Class Singleton {private volatile static Singleton Singleton; private singleton () {} public static Singleton getsingleton () {if (singleton = = Null ) {synchronized (Singleton. Class) {if (Singleton = = null ) {singleton = new Singleton (); }}} return Singleton; } } has been abandoned the use of a writing, specific can be stamped ....http://b
correspond to the real world.B. Analysis of reasons for business change: one responsibility is one reason for software change, which is also the essence of the principle of software design SRP, the single responsibility principle. At design time, the above business should be drawn out and assigned to the class that should have that responsibility.C. Finding an information expert7. What is an information expert?An information expert is a business obje
so-called Lod is to do the necessary interaction with only the necessary classes, which can reduce interdependent classes and the interfaces they provide externally. 4. Don't let a class do too much (SRP)and don't let an interface function do too much of it. 5. Clear functions to avoid misinterpretation A class, a module, a level of functional responsibility must be clear, to avoid ambiguity. This is a design problem and a management issue. 6. When t
style is required to make the code readable.
2. Adequate unit test guarantee (nowTest driver(Test driven) has been very important ).
Third, you must consider code reuse to maximize the use of existing methods orAlgorithmFunction implementation.
4. Always haveReconstruction(Refactoring) awareness to ensure that the Code is concise, efficient, readable, maintainable, scalable, and reusable in the process of continuous growth.
Fifth, the basic oo rules should be applied in a practical manne
important than the design model ?", The teacher is a developer with many years of practical experience. He did not hesitate to say, "What is more important than model is principle ". I often think of this sentence as a great answer. Indeed, what is more important than principles? Just like people's world outlook and outlook on life, it is the root of all your actions. For design patterns, why does this pattern solve this problem like this, and for other models, they all follow the principle of
. The Notice package contains all command objects that process cache update notifications. The factory package contains the c‑factory class, this class generates the corresponding subclass object of the ccommand Class Based on the message header.
The program code in the main package uses the ccommand class and the ccommandfactory class, so it inherits the creadcommand class according to the internal command package and internal factory; the class in the SCP package inherits from the creadcomma
the system, I plan to use the C/S architecture to implement the personnel management system:
Below are some of my original ideas:
for ORM operations, you can use the ADO. NET Entity Framework. The EF design retains high scalability in many places. On this basis, I plan to use SQL Server compact edition for development and testing during development.
adopts the warehousing mode and SRP based on the single responsibility principle, an
, only a deep understanding of them, your magic will be rapid. Object-oriented design principles-nine-yang martial art When you do any time, any occasion, only the object in the eyes, congratulations to you, the two veins have been opened, you can learn any advanced internal strength. Why first study internal strength, this everybody also familiar. No internal strength of the cooperation, any advanced moves are floating clouds. So to be invincible, must have a deep internal strength, such as
)Interface Isolation original principle (Interface segregation)Dependency inversion principle (Dependency inversion) Design pattern is the realization of the above principles, so as to achieve code reuse, increase the maintainability of the purpose.two. Single Responsibility principle single Responsibility PRINCIPLE,SRP Thought: For a class, there should be only one cause for it to change (a class has only one duty); Each cause of a class change
Object-oriented design principles and design patterns are also guidelines for the rational reconfiguration of the system, increasing our application maintainability and reusability Common object-oriented design principles include 7, these principles are not isolated, they depend on each other and complement each other. But keep in mind: "The open and closed principle is the goal, the Richter substitution principle is the basis, relies on the reversal principle is the means ", they complement eac
Seven Famous design principles1. Single Duty principle (Srp-single Responsibility Principle)As far as a class is concerned, there should be only one cause for it to change, with a single functionIf a class takes on too much responsibility, it is tantamount to coupling these responsibilities, and a change in responsibility may weaken or inhibit the ability of the class to perform other duties, which can lead to a fragile design that will suffer unexpec
functions;
"Appropriate notes" need to indicate code intent and design ideas as an effective guide to understanding the code; "Idioms" is a common pattern of code that facilitates quick browsing and comprehension.It is easy to modify the collection of code needed to quickly locate a functional service, requiring the code to have a good organization and implementation structure, avoid making the same or similar changes to multiple places, and avoid making drastic changes to the original over
The open-closed principle was mentioned in the previous blog post, not in detail. This time, let's summarize some of the principles of design patterns.1 Open-closed principle: refers to the software entities (classes, modules, functions, etc.) should be able to expand, but can not be changed.The principle of understanding: the opening and closing principle is the most idealistic color of a principle, it is the ultimate goal of object-oriented design, the following principles to be introduced in
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.