Posts
58
Comments
103
Trackbacks
10
Component Orientation

Yes, people, fasten your seatbelts.  Time for a quick introduction to an often misunderstood topic.  The term "component" is about as overloaded as the terms "service" and "object".  Please read this with your "curiosity" hat on.  I'm only attempting to inform here.

Pick a random developer off the street, and they will probably even give the same definition for each.  They are all about creating abstractions on a problem domain.  They all claim to promote reuse.  They all promote encapsulation.  And, they are all generally misunderstood and misapplied in the .NET community.

So what's the difference?  The difference between an object and a service is probably the easiest to see, but what about that component?  Let's focus on the object and the component for now.

Principles of Object-Orientation:

  • Single Responsibility Principle
  • Open/Closed Principle
  • Liskov Substitution Principle
  • Interface Segregation Principle
  • Dependency Inversion Principle
  • Single Choice Principle
  • Stable Abstractions Principle

Packaging Principles:

  • Acyclic Dependencies Principle
  • Release Reuse Equivalency Principle
  • Common Closure Principle
  • Common Reuse Principle
  • Acyclic Dependencies Principle
  • Stable Dependencies Principle
  • Stable Abstractions Principle

If these look foreign to you, I'd recommend you skip the rest of this article and grab a good book on OOP.  It'll change your professional life forever, I promise.  I often recommend Bob Martin's book.  He also has some great PDF articles available on the web (under Design Principles).

I'm largely going to skip over the OO stuff and assume you have a good handle on that programming paradigm.

I'll skip the fluff and go straight for the meat on components.

Defining a software component:

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only.  A software component can be deployed independently and is subject to composition by third parties.

--From the 1996 European Conference on OO Programming

Characteristics of a software component [Szy]:

  • is a unit of independent deployment
  • is a unit of third party composition
  • has no externally visible state

Characteristics of an object [Szy]:

  • is a unit of instantiation, each instantiation has a unique identity
  • may have state, and its state may be externally visible
  • encapsulates state and behavior

Principles of Component-Orientation [Low]:

  • Separation of Interface and Implementation
  • Binary Compatibility
  • Language Independence
  • Location Transparency
  • Concurrency Management
  • Version Control
  • Component-based Security

Tomorrow we will take a deeper look at what this means in terms of c# code and our development environment.

[Szy] : Component Software by Clemens Szyperski
[Low] : Programming .NET Components by Juval Lowy

posted on Wednesday, October 10, 2007 12:54 AM Print