|
|
|
|
Guidelines for object development
These stages suggest some guidelines when
thinking about developing your classes:
- Let a specific problem
generate a class, then let the class grow and mature during the solution of
other
problems.
- Remember,
discovering the classes you need (and their interfaces) is the majority of the
system design. If you already had those classes, this would be an easy
project.
- Don’t
force yourself to know everything at the beginning; learn as you go. This will
happen anyway.
- Start
programming; get something working so you can prove or disprove your design.
Don’t fear that you’ll end up with procedural-style spaghetti code
– classes partition the problem and help control anarchy and entropy. Bad
classes do not break good
classes.
- Always keep
it simple. Little clean objects with obvious utility are better than big
complicated interfaces. When decision points come up, use an Occam’s Razor
approach: Consider the choices and select the one that is simplest, because
simple classes are almost always best. Start small and simple, and you can
expand the class interface when you understand it better, but as time goes on,
it’s difficult to remove elements from a
|
|
|