What is decomposition of objects?

I tried to understand what decomposition of an object is, and read a lot of things on the Internet, but each resource says a lot of keywords that I could not understand. Therefore, these resources expect you to learn a few terms. I need something that lists the basics of decomposition from scratch.

Is it nothing but the destruction of design into objects? If not, any description will be appreciated.

Thanks in advance

+7
source share
3 answers

Imagine you have a Car facility. This is a very large facility that is difficult to maintain. You break these objects into less responsibility for part of the problem domain:

  • Engine
  • Cabin
  • Loading
  • ...

That decomposition, each of these objects can be broken again, for example, the Cabin consists of Board, Sits, Wheel ... Or, probably, the Board consists of Wheel and other parts. Etc.

+11
source

I think that you basically understood this - juxtaposing the things of the β€œreal world” with which you will work with representations as objects in your code.

Sometimes people call this simulation because they create a β€œmodel” in the code for things and concepts in the real world, such as employees, accounts, birthdays, cameras, etc. - some physical, others ephemeral, but they should all be represented as objects in the code.

+3
source

Speaking composition in C ++, this means that you are installing an object from a class that I called it A (possibly containing three data elements, for example three built-in types in the form of integers, so as not to make it too complex) to another class that I named B (and possibly along with other data members belonging to class B).

In turn, the actual muy puzzle is to figure out how to decompose this object from class A, which was included in class B. Almost 50% of the time (without linking to this site, because this is my first active participation) was released me because I know that I won’t have any concrete help ... so let me go dig into my collection of books at level 2 of C ++ and study

+2
source

All Articles