2

I have a few questions concerning the differences between IoC and CBSE that I cant find for the life of me.

I have been using IoC/DI for quite a while now specifically with Laravel in PHP, so I like to think I have a pretty good grasp on how it works and how to use it. I recently purchased a book "Component-Based Software Engineering" by George T. Heineman. I ran into some confusion when it came to how the components communicated with other components so started doing some online research. I am specifically looking up C# examples and from what I can tell CBSE closely resembles Ioc/DI and in some cases I often wonder if people are just calling it the wrong thing.

The biggest difference I can see when reading the book is instead of injecting the dependency its more linear and in your interface your telling it what class your wanting to use. I feel as if I am completely off base and missing the whole point of CBSE but cant find any information that's giving me the ahah moment.. Anyone able to provide some information that may clear this up?


Small Update:
The idea behind CBSE if I am understanding it correctly sounds really good. But I am getting hung up on how the components talk to each other. If I understand right the components shouldn't know anything about any of the other components out there. So while throwing events for everything would work that only works if the component needing the information knows and or expects there to be x component throwing that event.

I am trying to figure this out for a few reasons. See if this is a route I want to learn and start using for my job as an application programmer, as well as my hobby for game programming. I came about CBSE through researching game programming.

Silent
  • 438
  • 2
  • 6
  • 19

1 Answers1

1

Component based software engineering is a paradigm of software development that specifies that one should build software against interface dependencies so as to maximize the encapsulation and reusability of components. This paradigm, in many languages, requires inversion of control in order to satisfy this paradigm.

However, component based software engineering isn't inversion of control, it's just a model of software design that is most easily and completely accomplished by using DI and IoC containers. For C#, if you want to go down the route of component based software engineering, then I would look into getting familiar with how DI, IoC, and their respective containers operate.

Nishmaster
  • 525
  • 3
  • 10
  • That only confused me more! The books, and all the examples I have looked at none of them have used IoC. I am familiar with IoC and DI(use it in most my projects), and if I go that route not sure why I would use CBSE at all. – Silent Mar 24 '14 at 13:22
  • When are the books from? CBSE is not really a very recent term, and originates from the 80's when the concepts of IoC and reflection did not exist. In C++, for example, you can't use a DI container because there is no metadata to satisfy it. CBSE simply means: program to interfaces, so you can easily swap parts out later. Today, the most complete way to do that is via DI/IoC, but as long as you are programming to interfaces for reuse, you are already doing CBSE. – Nishmaster Mar 24 '14 at 13:36
  • That makes sense and pretty much answers exactly what I had in my head. I thought it sounded like I already was in theory. Thank you for the answers Nish! – Silent Mar 24 '14 at 13:38