开发者

What is Object Decomposition?

开发者 https://www.devze.com 2023-02-03 22:04 出处:网络
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. So these resources exp

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. So these resources expect you to know a few terms. I need something that lists the basics of decomposition from scr开发者_如何学JAVAatch.

Is it anything more than breaking the design into objects? If no, any description will be appreciated.

Thanks in advance


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.


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.


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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号