Advanced OOP - Laws, Principles, Idioms
Upcoming SlideShare
Loading in...5

Advanced OOP - Laws, Principles, Idioms



Ever heard of the Law of Demeter? How about the Liskov Substitution Principle? This talk introduces key object-oriented laws and principles currently used in our field and provides guidance for their ...

Ever heard of the Law of Demeter? How about the Liskov Substitution Principle? This talk introduces key object-oriented laws and principles currently used in our field and provides guidance for their use when building applications on the .NET platform.



Total Views
Views on SlideShare
Embed Views



7 Embeds 299 247 27 16 6 1 1 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Advanced OOP - Laws, Principles, Idioms Advanced OOP - Laws, Principles, Idioms Presentation Transcript

  • Advanced OOP Laws Principles Idioms Clint Edmonson
  • what is oop?
  • abstraction encapsulation inheritance polymorphism
  • structural
  • domain driven design
    • All software can be composed of only four elements:
    • - Value objects
    • - Entities
    • - Services
    • - Modules
  • separation of concerns
      • Every class and method should have a single responsibility .
      • All its functionality should be narrowly aligned with that responsibility.
  • the DRY principle
    • Don’t repeat yourself .
    • Don’t repeat yourself.
    • Don’t repeat yourself.
  • theory of one right place
      • There should be only one right place for a piece of nontrivial of code,
      • and one right place to make a likely maintenance change.
  • unit of work
    • Define entity families around transactional boundaries.
  • the open-closed principle
    • Software entities (classes, methods, and modules) should be
    • open for extension
    • but closed for modification .
  • design by contract
    • Fortify your methods through
    • preconditions ,
    • post-conditions ,
    • and invariant assertions.
  • creational
  • declarative programming
    • Use attributes to describe what you want to happen and leverage a framework will take care of the how .
  • the provider model
    • Define a public service façade that uses an private implementation to perform all of it’s work.
  • inversion of control
      • Leverage configuration files to automatically create objects as they are needed.
  • dependency injection
      • Declaratively describe dependencies between classes and an IOC framework can automatically instantiate all of them.
  • object : relational mapping
      • Leverage IOC and dependency injection to automatically load entities from your database.
  • behavioral
  • principle of scenario driven design
      • All functionality should be driven by usage scenarios.
  • occam ’ s razor
      • The simplest solution is usually the best .
  • the pareto principle
      • For many phenomena, 80% of the consequences stem from 20% of the causes
  • the law of demeter
    • “ Don’t talk to your neighbor’s neighbor!”
    • An object should only call methods and properties belonging to:
    • - Itself
    • - Any parameters passed in
    • - Objects it creates
    • - Child components
  • principle of least resource usage
      • The minimal amount of computational resources should be used to solve a particular need.
  • principle of least privilege
      • Provide the minimal level of access necessary for consumers to do their job.
      • Combined with the previous principle…
      • Classes and methods should be as static and private as possible.
  • the liskov substitution principle
      • A derived class should be completely and transparently substitutable for it’s base class.
  • idempotents
      • Transactional systems should allow the
      • same information to be received multiple times without being reprocessed .
  • cyclomatic complexity
      • The depth of nested logic should be kept to a minimum .
  • What are your principles?
  • Questions & Discussion
    • Books
      • Code Complete - McConnell
      • Effective C# - Wagner
      • Framework Design Guidelines – Cwalina & Abrams
      • Writing Solid Code - Maguire
    • Links
      • Application Architecture for .NET
      • OO Design Principles
      • Principles of Object Oriented Design
      • Separation of Concerns (Wikipedia)
  • Clint Edmonson
      • [email_address]
  • © 2008 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this information.