Separation of Concerns
In software engineering, separation of concerns is a term used to describe the process of breaking down a system into distinct components, where each component performs a unique task that does not overlap with another. Separation of concerns is an approach to problem solving where we break the complexity of a problem into more simple, loosely-coupled components. By modularizing our concerns, we promote software testability, reuse, comprehensibility, maintainability, and extensibility just to name a few.
Abstraction is the principle method for separating concerns. Concerns are individual pieces of interest, or focus, in a program (SoCWiki, 2006). Object-oriented programming languages aid in the process of separating concerns with classes and methods. To separate components, we need to think about what that component truly needs to do, and how much it needs to know in order to perform its functionality. When implementing the separation of concerns concept, determine the desired functionality of the component, and the minimum amount of information required for it to function.
Abstraction
Abstraction, in my opinion, is one of the more complex concepts to understand in object-oriented programming. First, the understanding of abstraction requires a good cognizance of objects, classes, inheritance, encapsulation, and polymorphism. Second, the definition of abstraction is somewhat abstract, in that it is not specific. Third, the ability to apply abstraction when designing a system demands OO concept recognition, which takes time and practice. In the following sections describing abstraction, I hope to define abstraction and provide examples that will make this concept less intimidating.
Defining Abstraction
Abstraction is a process of recognizing common attributes and behaviors that are shared among concepts, and designing a system that leverages these generalizations. Abstraction helps identify commonalities in concepts that can be arranged in a way that will promote object reusability in more than one context, without having to repeat the details of each context.
Abstraction is the process of reducing system complexity. It is the presentation of a simple concept to the external world, while hiding or delegating the detailed implementations. In abstraction, one captures only the essential attributes and behaviors of a component. "Abstraction is the elimination of the irrelevant and the amplification of the essential" (Martin, 1995).
Advantages of abstraction are the hiding of implementation details, component reuse, extensibility, and testability. When we hide implementation details, we reveal a cleaner, more comprehensible and usable interface to our users. We are separating our interface from our implementation, and this makes component reuse more practical. Many, if not all of the object-oriented concepts we have discussed throughout this document play a role in the abstraction principle. Working together, their end goal is the same, to produce software that is flexible, testable, maintainable, and extensible.
References:
Martin, R. (1995). Designing Object Oriented C++ Applications Using The Booch Method (1st ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.
SoCWiki. (n.d.). Retrieve May 30, 2006, from http://en.wikipedia.org/wiki/Separation_of_concerns
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010 MuellerDesigns.net
Sign In