What is Object Decomposition?

后端 未结 3 1479
小蘑菇
小蘑菇 2021-02-14 04:10

I was trying to understand what object decomposition means and read a lot of stuff on internet but every resource talks in terms of lots of keywords that i couldn\'t understand.

相关标签:
3条回答
  • I think you've basically got it correct -- mapping the "real world" things you'll be working with to representations as objects in your code.

    Sometimes people call this modeling, because they are creating a "model," in code, for things and concepts in the real world, like employees, accounts, birthdays, cameras, etc. -- some physical, others ephemeral, but all needing to be represented as objects in code.

    0 讨论(0)
  • 2021-02-14 04:25

    By saying composition, in C++, it means you set a object from a class that I named it A (maybe containing three data members, for example three built in type as integers to not make things too complicated) into another class that I named B (and possibly together to others data members belonging to class B).

    In turn, muy actual puzzle is to figure out how to decompose this object from class A that was included in class B. As almost 50% of the time,(not refering& to this site because this is my first active participation) let me go because I khnow I won´t have a concrete help...so let me go to dig down into my collection two feet height C++ books and study

    0 讨论(0)
  • 2021-02-14 04:31

    Imagine, you have Car object. It is very large object, hard to support. You break this objects into smaller responsible for some part of the problem domain:

    • Engine
    • Сabin
    • Boot
    • ...

    That's the decomposition, each of that objects can be broken again, like Cabin consist of Board, Sits, Wheel... Or probably Board consist of Wheel and other parts. Etc.

    0 讨论(0)
提交回复
热议问题