Managing complexity is the most important technical topic in software development.
The goal of all software-design techniques is to break acomplicated problem into simple pieces. The more independent the subsystems are, the more you make it safe to focus on one bit of complexity at a time.
Abstraction is the ability to engage with a concept while safely ignoring some of its details - handling different details at different levels.
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.
Encapsulate picks up where abstraction leaves off. you aren't allowed to look at an object at any level of detail.
Inheritance simplifies programming because you write a general routine to handle anything that depends on a door's general properties and then write specific routines to handle specific operations on specific kinds of doors.
Information hiding is part of the foundation of both structured design and object-oriented design. In structured design, the notion of "black boxes" comes from information hiding. In object-oriented design, it gives rise to the concepts of encapsulation and modularity and it is associated with the concept of abstraction.
One key task in designing a class is deciding which features should be known outside the class and which should remain secret.
Accommodating changes is one of the most chanllenging aspects of good program design. The goal is to isolate unstable areas so that the effect of a change will be limited to one routine, class, or package.
areas that are likely to change:
Coupling describes how tightly a class or routing is related to other classes or routines. The goal is to create classes and routines with small, direct, visible and flexible relations to other classes and routines.
Classes and routines are first and foremost intellectual tools for reducing complexity. If they're not making your job simpler, they're not doing thier jobs.
Popular Design Patterns
Design is an iterative process. You don't usually go from point A only to point B; you go from point A to point B and back to point A.
no one's skill is big enough to contain all the details of a complex program, and that applies just as well to design. Divide the program into different areas of concern, and then tackle each of those area individually.
Top-down design begins at a high level of abstraction. You define base classes or other nonspecific design elements. As you develop the design, you increase the level of detail, identifying derived classes, collaborating classes, and other detailed design elements.
Bottom-up design starts with specifics and works toward genealities. It typically begins by identifying concrete objects and then generalizes aggregations of objects and base classes from those specifics.