Tag Archives: dependency injection

Component granularity explained as Baby-Bear, Momma-Bear and Papa-Bear

When talking about components people use the same word for different levels of granularity making it very confusing. Is one object considered to be a component? Is a class library a component?

Is a component the boundary between intra-component synchronous and inter-component asynchronous communication?

Pat Helland created an overview using the Three Bears analogy: Baby-Bear, Momma-Bear and Papa-Bear. Below you see a summary but you can always visit his weblog for details.

It is just funny and because of that, developers will remember during discussion about components to ask themselves at what level of component granularity the discussion is going on.

Components

Summary:

  • Baby-Bears are much like the classic object with inheritance, reference-passing, and synchronous interactions with their callers.
  • Momma-Bears (closely related to what is provided by MEF), are comprised of multiple Baby-Bears. While exhibiting synchronous call patterns, they do not support pass-by-reference nor inheritance. They will, however, allow for support of dependency injection.
  • Papa-Bears are the biggest of the three and are most similar to a SOA Service. A Papa-Bear will typically be composed of multiple Momma-Bears. Papa-Bears interact with their partners asynchronously, are frequently remote, do not support pass-by-reference or inheritance, and may be offline.