Refactoring
- SOFTWARE REFACTORING APPLIED TO C PROGRAMMING LANGUAGE
- Challenges of Refactoring C Programs
- Refactoring-based Requirements Refinement Towards Design
- CScout: A Refactoring Browser for C
- Replace Inheritance with Delegation
- A subclass uses only part of a superclasses interface or does not want to inherit data.
- Your subclass violates the Liskov substitution principle, i.e., if inheritance was implemented only to combine common code but not because the subclass is an extension of the superclass.
- The subclass uses only a portion of the methods of the superclass.
- .NET and Multiple Inheritance
- So what’s the solution? Often people are directed to using interfaces, but interfaces don’t lend themselves very well to meet the requirements of reusing code and implementing separation of concern; as interfaces are really intended to support polymorphism and loosely-coupled/contractual design.
- But other than trying to tie behaviors into object inheritance hierarchies, there are many alternative approaches that can be evaluated to meet those requirements. For example, adopting relevant design patterns like Visitor, frameworks like MVC, delegates, mixins (interfaces combined with AOP), etc.
- The reason to replace a modifier(such as static) with a constant(e.g. STATIC)
- The modifier can be removed by a empty define
- For production builds use -dSTATIC=static
- For unit test builds use -dSTATIC
- The modifier can be removed by a empty define
page revision: 10, last edited: 22 Apr 2016 06:25