Monday, October 11, 2010

Awesome explanation of software "coupling"

Coupling and Cohesion : Coding Notes:
Legos, the toys that SNAP together would be considered loosely coupled because you can just snap the pieces together and build whatever system you want to. However, a jigsaw puzzle has pieces that are TIGHTLY coupled. You can’t take a piece from one jigsaw puzzle (system) and snap it into a different puzzle, because the system (puzzle) is very dependent on the very specific pieces that were built specific to that particular “design”. The legos are built in a more generic fashion so that they can be used in your Lego House, or in my Lego Alien Man.

2 comments:

  1. Great explanation...now explain vendor abstraction in such a simple manner :)

    ReplyDelete
  2. "Vendor abstraction" simply means that you design your system so that it does NOT depend on one particular vendor of a module or component. In order to "abstract a vendor", first identify all of the boundaries between the vendor's product and your system. Second, create a specification independent of the vendor that includes all of the functionality provided by that vendor. Next, create an implementation of the specification you created that forwards to the vendor you are abstracting. Finally, change your system so that it does not refer directly to the vendor's product, but instead uses the specification you designed earlier.

    ReplyDelete