I recently became a member of IEEE. I learned to love scientific journals while studying at the university, and I wanted easier access to the journals I read the most. Yesterday I read an interesting empirical study in IEEE Software about components and objects, and their reusability. If you don’t know what empirical study is just know that it’s research done on direct or indirect observation, not a study citing other studies. It also tends to have a direct goal, looking to answer a specific question.
Study: Atish P. Sinha, Hemant Jain, “Ease of Reuse: An Empirical Comparison of Components and Objects,” IEEE Software, vol. 30, no. 5, pp. 70-75, Sept.-Oct. 2013, doi:10.1109/MS.2012.131
A component is a reusable part that is independent, but not a full system. It does one thing and does it well, but you cannot modify it. Wikipedia uses a card processing component as an example, and as you might have guessed its not object oriented. In Component Based Development the components are combined to make a system, in object oriented programming we have objects that are supposed to resemble how the objects in our world work. A person is a person. A component is what it does/aimed at.
Both claim reusability, and both ways are. But which one wins?
According to this study components were considered easier to reuse. Two groups, identical, had to create a system- one group with components the other using a library, after first using both creating an insurance claim system. Afterwards they were asked questions and those were rated 1-7. 68 out of 76 completed.
I tried finding a duplicate of the study with more information, such as length of study, drop out reasons, how the survey (confirmation bias- internal validity) was done and if components and class libraries had been evaluated and were perceived to be of good and equal quality and so on (external validity and construct).
There is an underlying suggestion that component based developing is the future, and the result of that study confirms that. However I can’t say based on that that OOP is less reusable than components, I would instead argue that it depends on the context a demands. As in the study, to put together a small non-customized system, then I would hope components were easier to reuse as they are independent modules that are well documented. But as soon as you need to customize, which you often do,- or trouble shoot/add fixes, OOP provides and advantage by not being a ‘black box’. And those possibilities come at a slight cost, you need more knowledge of the libraries, OOP SOLID design, and what not.
The relation between of SOA – Service Oriented Architecture and CBD- Component Based Development, and combining those with OO and AOP (Aspect Oriented Programming) would give a more nuanced picture, but I’ll write about that in another post.
Let me know, as always, what you think.
I’m a mere a newb programmer trying to fully understand the large world of programming 😉