Question

In software engineering there are two main concepts in design phase which are abstraction and decomposition but I can't get the differences between them?

Was it helpful?

Solution

Both concepts are analysis & design basic techniques. There are interrelated and normally used together during software development. We use them even though we are not always aware of it. Deeper understanding of these concepts helps to be more accurate and effective in A&D.

Abstraction in general is process of consciously ignoring some aspects of a subject under analysis in order to better understand other aspects of it. In other words, it kind of simplification of a subject. In software in particular, analysis & design are all about abstraction.

  • When you model your DB, you ignore UI and behavior of your system and concentrate only on DB structure.
  • When you model your architecture, you concentrate on high-level modules and their relationships and ignore their internal structure
  • Each UML diagram for example gives a special, limited view on the system, therefore focusing on a single aspect and ignoring all other (sequences abstract objects and messages, deployment abstracts network and servers, use cases abstract system users and their interactions with a system, etc)
  • writing source code in any programming language requires a lot of abstraction - programmers abstract app's functionality using limited set of language constructs

Decomposition is an application of the old good principle "divide and conquer" to software development. It is a technique of classifying, structuring and grouping complex elements in order to end up with more atomic ones, organized in certain fashion and easier to manage. In all phases there are lots of examples:

  • functional decomposition of a complex process to hierarchical structure of smaller sub-processes and activities
  • high-level structure of an complex application to 3 tiers - UI, logic and data.
  • Class structure of a complex domain
  • namespaces as a common concept of breaking a global scope into several local ones
  • UML packages are a direct use of decomposition on the model level - use packages to organize your model

Abstraction is somehow more generic principle than decomposition, kind of "father of all principles" :)

OTHER TIPS

Abstraction is one of the fundamental principles of object oriented programming. Abstraction allows us to name objects that are not directly instantiated but serve as a basis for creating objects with some common attributes or properties. For example: in the context of computer accessories Data Storage Device is an abstract term because it can either be a USB pen drive, hard disk, or RAM. But a USB pen drive or hard disks are concrete objects because their attributes and behaviors are easily identifiable, which is not the case for Data Storage Device, being an abstract object for computer accessories. So, abstraction is used to generalize objects into one category in the design phase. For example in a travel management system you can use Vehicle as an abstract object or entity that generalizes how you travel from one place to another .

Decomposition is a way to break down your systems into modules in such a way that each module provides different functionality, but may affect other modules also. To understand decomposition quite clearly, you should first understand the concepts of association, composition, and aggregation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top