• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

decoupled?

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read on the design pattern book (head first) that classes should be decoupled, what does that mean? can anyone give an example?

thanks
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WikiPedia often says it better than I can.

Reducing coupling is a big part of managing dependencies which is one of the core drivers in OO design. See what kind of questions the WikiPedia article raises, and lets talk more about where coupling might take you.
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok...I got it. I learned the usage of the Command Design-Pattern and I realized what makes a decoupled objects.

the user's interface component and the command (the event handling) are decoupled.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once you get interested in dependencies you can dig into some of the core principles of OO. HERE is a blog where Robert Martin introduces his catalog of principles. His PPP Book expands on all of these. Highly recommended.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic