Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Object Decomposition?

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 scratch.

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

Thanks in advance

like image 495
Asif Avatar asked Jan 13 '11 18:01

Asif


2 Answers

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.

like image 89
Maxym Avatar answered Sep 30 '22 13:09

Maxym


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.

like image 37
Jay Avatar answered Sep 30 '22 14:09

Jay