answersLogoWhite

0

From the question it seems you are asking about designing a good program.

This is a list of goals that a developer should try and have in their software design. Some goals contradict other ones, but that is where you have to decide what is best for your program.

Minimal ComplexityThe main goal in any program should be to minimize complexity. As a developer most of your time will be maintaining or upgrading existing code. If it is a complete mess, then your life is going to be that much harder. Try and avoid those solutions where you use a one line complex solution to replace 20 lines of easy to read code. In a year, when you come back to that code, it will take you that much longer to figure out what you did. Ease Of MaintenanceThis is making your code easy to update. Find where your code is most likely going to change, and make it easy to update. The easier you make it, the easier your life is going to be down the road. Think of it as a little insurance for your code. Loose CouplingSo What is loose coupling? It is when one portion of code is not dependant on another to run properly. It is bundling code into nice little self reliant packages that don't rely on any outside code. How do you do this? Make good use of abstraction and information hiding ExtensibilityThis means that you design your program so that you can add or remove elements from your program without disturbing the underlying structure of the program. A good example would be a plug-in. ReusabilityWrite code that will be able to be used in unrelated projects. Save yourself some time. . High Fan-inThis refers to having a large number of classes that use a given class. This implies that you are making good use of utility classes. For example you might have a bunch of classes that use the Math class to do calculations. Low to medium Fan-outThis refers to having a low to medium amount of classes used by any given class. If you had a class that includes 7 or more classes this is considered high fan out. So try and keep the number of classes you include down to a minimum. Having a high fan-out suggests that the design may be too complex. PortabilitySimply put, design a system that can be moved to another environment. This isn't always a requirement of a program, but it should be considered. It might make your life easier if you find out your program does have to work on different platforms. LeannessLeanness means making the design with no extra parts. Everything that is within the design has to be there. This is generally a goal if you have speed and efficiency in mind. A good example of where this might come in handy is creating a program that has to run on a system with limited resources (cell phone, older computers) Standard TechniquesTry and standardize your code. If each developer puts in their own flavor of code you will end up with an unwieldy mess. Try to layout common approaches for developers to follow, and it will give your code a sense of familiarity for all developers working on it.
User Avatar

Wiki User

15y ago

What else can I help you with?