Good classes exhibit this Sequential a set of procedures which work in sequence

Good classes exhibit this sequential a set of

This preview shows page 2 out of 2 pages.

together, and everything else is kept out. Good classes exhibit this. —Sequential: a set of procedures, which work in sequence to perform some computation, is kept together. The output from one is input to the next, everything else is kept out. —P rocedural: a set of procedures, which are called one after another is kept together, everything else is kept out. Temporal: procedures used in the same general phase of execution such as initialization or termination, are kept together. Utility: related utilities are kept together when there is no way to group them using a strong form of cohesion. 3.Reduce coupling: coupling occurs when there are interdependencies between one module and another interdependency making changes in one place will require changes somewhere else. Types of coupling: —Content: a component surreptitiously modifying internal data of another component. Avoid this. Common : the use of global variables. Severely restrict this Control : one procedure directly controlling another using a flag. Reduce this with polymorphism. Stamp : one of the argument types of a method is one of your application classes. If it simplifies the system, replace each such argument with a simpler argument (an interface, a superclass or few simple data items) Data : the use of method arguments that are simple data. If possible, reduce the number of arguments routine call: A routine calling another. Reduce the total number of separate calls by encapsulating repeated sequences type use : The use of a globally defined data type. Use simpler types where possible( superclass or interface) inclusion /export: including a file or importing a package. External: A dependency exists to elements outside the scope of the system, such as the operating system, shared libraries or the hardware. Reduce the number of dependencies 4.Increase abstraction: ensure that your design allows you to hide or defer consideration of detail, thus reducing complexity. Abstraction allows you to understand the essence of a subsystem without having to know unnecessary details 5.Increase reusability: design the various aspects of your system so that they can be used again in other contexts. —Generalize your design—Follow the preceding three steps—Design your system to contain hooks—Simplify your design—Reuse: actively attempt to reuse code 6. Reuse where possible: design with reuse is complementary to design for reusability Actively reusing designs or code allows you to take advantage of the previous investment in reusable code(cloning is not reuse) 7.Design for flexibility: anticipate changes and prepare, do not hard code and leave all options open. 8.Anticipate obsolescense: —Avoid using early released technology —Avoid libraries not specific to particular environments —Avoid undocumented features —Avoid companies that do not provide long term support —Use standard languages and technology 9.Design for portability : having the software run on as many platforms as possible. Avoid the use of facilities that are specific to one particular environment. 10.Design for testability:
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture