Design Smells and Oo Design Principles

xiaoxiao2021-03-06  101

Design Smell - The Odors of Rotting Software

1.Rigidity - THe system is hard to change because every change forces many changes to other parts of the system.2.Fragility other - Changes cause the system to break in places that have no conceptual relationship to the part that was changed.3. immobility - It is hard to disentangle the system into components that can be reused in other system.4.Viscosity - doing things right is harder than doing things wrong.5.Needless Complexity - The design contains infrastructure that adds no direct benefit.6. NEEDLESS Repetition - The Design Contains REATING STRUCTURES THAT COULD BE Unified Under A Single Abstract.7.opacity - It is hard to read and understand.it does not express its intent Well

Princples of Object-Oriented Design That Help Developers Eliminate Design SMELLS AND BUILD The Best Designs for the Current Set of Features

SRP - The Single Responsibility Principleocp - The Open-Closed Principlelsp - The Lisk Substitution PrinciP - The Dependency Inversion Principleisp - The Interface SegRegation Principle

SRP: A class should have only one reason to change.OCP: Software entities (. Classes, modules, functions, ect) should be open for extension, but closed for modification.LSP: Subtypes must be substitutable for their base types.DIP: High-level modules should not depend on low-level modules.Both should depend on abstractoins; Abstractions should not depend on details.Details should depend on abstractions.ISP: Classes have "fat" interface can be broken into groups of methods by, each Group Serves A Different Set of Clients; Clients Should Not Know About Them As a Single Class.refer To The << Agile Software Development >> - Martin

转载请注明原文地址:https://www.9cbs.com/read-123977.html

New Post(0)