Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 25, 2024, 02:24:39 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Code reuse
Pages: 1 2 [3]
Print
Author Topic: Code reuse  (Read 9754 times)
Klaim
Level 10
*****



View Profile WWW
« Reply #40 on: August 16, 2008, 04:14:06 AM »

 1) K.I.S.S. : Keep It Simple, Stupid! The more it is simple, the easier it can be used elsewhere.

 2) ONE and ONLY ONE feature by system. By system i mean one or more classes that work together and never should be used separately. Your system could be a String class (one class). Or a Task class and a TaskManager class (2 classes). The point is to make it like composants that provide one feature and then can be used in unknown ways. Think of it like electronic composants : each one provide only one specific feature.
When you have your ONE feature system, then you can make other ONE feature systems on top of it that enhance the previous system. This way, when you need only the original feature you can use the first system. When you need more advanced manipulations of this system, you can use the systems on top of it that provide the features you need.
Make it fine grain.

 3) Make it Black Box : Don't assume the user will plunge in the guts of your code to see what should happen. Simply make all the usage of your system (THAT PROVIDE ONLY ONE FEATURE!!) obvious by looking at the provided interfaces. Isolate your system from external noise.
Logged

Pages: 1 2 [3]
Print
Jump to:  

Theme orange-lt created by panic