Showing posts with label Computer Science. Show all posts
Showing posts with label Computer Science. Show all posts

Wednesday, November 9, 2016

house analogy

build one house that fulfills 100 people's design requests - that's software

Monday, November 11, 2013

Dependency injection

here

if the pattern used creates the dependencies in properties but allows sets as follows:

#if DEBUG
            set { m_blah = value; }
#endif


I am not sure if this is true dependency injection

Wednesday, August 7, 2013

Code refactoring

  • Techniques that allow for more abstraction
    • Encapsulate Field – force code to access the field with getter and setter methods
    • Generalize Type – create more general types to allow for more code sharing
    • Replace type-checking code with State/Strategy[6]
    • Replace conditional with polymorphism [7]
  • Techniques for breaking code apart into more logical pieces
    • Componentization breaks code down into reusable semantic units which present clear, well-defined, simple-to-use interfaces.
    • Extract Class moves part of the code from an existing class into a new class.
    • Extract Method, to turn part of a larger method into a new method. By breaking down code in smaller pieces, it is more easily understandable. This is also applicable to functions.
  • Techniques for improving names and location of code

from here 

Thursday, February 9, 2012

Interesting phenomenon with class constructors in inherited classes

when the constructor is static first the descendant will run and then the ancestor.
when its an instance constructor its the other way around.

the reason being that there is no inheritance in static contructors