Mapa mental
Heuristics

Contenido del mapa
Heuristics
Find Real-World Objects
- Identifying real-world and synthetic objects
- Steps
- Identify methods and data
- What can be done to an object?
- What each object is allowed to do to others?
- Which parts will be public and which will be private?
- Define each object’s public interface
- Programming-language
- Formal
- Syntactic
- Define each object’s public interface
- Which parts will be public and which will be private?
- Operations can be performed on an object
- What each object is allowed to do to others?
- Relevant characteristics
- What can be done to an object?
- Identify methods and data
- Steps
- Identifying real-world and synthetic objects
Form Consistent Abstractions
- Abstraction
- Handle different details at different levels
- Example
- A good class interface is an abstraction that allows you to focus on the interface without needing to worry about the internal workings of the class
- Example
- Simple view, complex concept
- Handle different details at different levels
- Abstraction
Encapsulate Implementation Details
- Manage complexity by forbidding you to look at the complexity
- Basically
- What you see is what you get—it’s all you get!
- Basically
- Manage complexity by forbidding you to look at the complexity
Inherit
- Defining similarities and differences among objects
- Different levels of details
- Benefit
- Works with abstraction
- Defining similarities and differences among objects
Hide secrets/Information hiding
- Foundation
- Structured design
- Black boxes
- Object-oriented design
- Encapsulation
- Modularity
- Abstraction
- Structured design
- Good class interface
- Leaves most of it unexposed
- Foundation
Identify Areas Likely to Change
- Isolate unstable areas
- Steps
- Identify items that seem likely to change
- Separate items that are likely to change.
- Isolate items that seem likely to change
- Interclass interfaces are insensitive to potential changes
- Compartmentalize volatile components
- Isolate items that seem likely to change
- Separate items that are likely to change.
- Identify items that seem likely to change
- Steps
- Some areas
- Business rules
- Hardware dependencies
- Input and output
- Nonstandard language features
- Difficult design and construction areas
- Status variables
- Isolate unstable areas
Keep Coupling Loose
- Coupling
- How tightly a class or routine is related to others
- Coupling criteria
- Size
- Visibility
- Flexibility
- Kinds of coupling
- Simple-data-parameter
- All the data passed between them are of primitive data types and all the data is passed through parameter lists
- Simple-object
- A module instantiates an object
- Object-parameter
- Object1 requires Object2 to pass it an Object3
- Semantic coupling
- Module makes use of some semantic knowledge of another module’s inner workings
- Simple-data-parameter
- Goal
- Create classes with small relations
- Coupling
Look for Common Design Patterns
- Provide the cores of ready-made solutions
- Pattern
- Provide several benefits that fully custom design doesn’t
- Reduce complexity
- Provide ready-made abstractions
- Reduce errors
- Institutionalizing details of common solutions
- Provide heuristic value
- Suggests design alternatives
- Streamline communication
- Moving the design dialog to a higher level
- Popular Design Patterns
- Abstract Factory
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Factory Method
- Iterator
- Observer
- Singleton
- Strategy
- Template Method
Other Heuristics
- Aim for Strong Cohesion
- Cohesion
- How focused the class is
- Useful tool for managing complexity
- More that code in a class supports a central purpose
- Easier for your brain to remember everything
- More that code in a class supports a central purpose
- Cohesion
- Build Hierarchies
- Hierarchy
- Tiered information structure
- Most general representation of concepts is at the top
- Specialized representations at the lower levels
- Most general representation of concepts is at the top
- Allow to focus on only the level of detail currently concerned with
- Tiered information structure
- Hierarchy
- Formalize Class Contracts
- Class interface is a contract with the rest of the program
- Useful for managing complexity
- Object can safely ignore any noncontractual behaviour
- Useful for managing complexity
- Class interface is a contract with the rest of the program
- Assign Responsibilities
- How responsibilities should be assigned to objects
- Design for Test
- Ask what the system will look like if you design it to facilitate testing
- Result in
- More formalized class interfaces
- Result in
- Ask what the system will look like if you design it to facilitate testing
- Avoid Failure
- Choose Binding Time Consciously
- Binding time
- Time a specific value is bound to a variabe
- Code that binds early tends to be simpler
- Tends to be less flexible
- Code that binds early tends to be simpler
- Time a specific value is bound to a variabe
- Binding time
- Make Central Points of Control
- Control
- Centralized in
- Classes
- Routines
- Preprocessor macros
- Centralized in
- Fewer places to look for something
- Control
- Consider Using Brute Force
- Better than an elegant solution that doesn’t work
- Draw a Diagram
- Can represent the problem at a higher level of abstraction
- Keep Your Design Modular
- Modularity
- Goal
- Black box
- Related to
- Encapsulation
- Information hiding
- Goal
- Modularity
- Aim for Strong Cohesion
Imágenes y archivos del mapa
Información
- Descripción
- Mapa Mental sobre Heuristics, creado por Annie Chase el 26/03/2019.
- Creado por
- Annie Chase
- Visitas
- 0
- Valoración

























