Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OOAD 486 - Architecture doubt

 
Marcos Urata
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From an OOAD�s simulator exam:

"In a layered architecture, the upper layers are more
application specific and volatile while the lower
layers are more generic and stable. Collaboration and
coupling should therefore be from higher to lower
layers to reduce the ripple effect of changes in any
layer."

I do not agree with the quoted phrase above. If
coupling should be from higher to lower layers, the
following code would be considered well layered:



I think that the correct would be that coupling and
collaboration s



I would like to hear some comments about it.
Thanks
Marcos Urata
 
Mikalai Zaikin
Ranch Hand
Posts: 3371
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marcos !

I don't see any problems with the quote about architecture.
I don't see any problems in your code understanding as well.

You just mixed lower and higher layers

Layers are as follows :



So, when JFrame depends on Customer class - this is a example of good architecture.

If you need access from lower layers to higher - you can use Observer-Observable pattern.

regards,
MZ
 
Marcos Urata
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I guess I was reading the layers order the wrong way. Thanks
 
Mikalai Zaikin
Ranch Hand
Posts: 3371
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like...
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mikalai Zaikin:

If you need access from lower layers to higher - you can use Observer-Observable pattern.

regards,
MZ


Do you mean to say that Observer pattern is one of the ways of providing a loose coupling when you need to communicate from say Business layer to the presentation layer, for example? I guess your point is that the core service layers shouldn't have any knowledge of their user and hence should use the notification mechanism. I agree with that 100%. I'm not totally convinced about this approach is going to work in all scenarios. I'll try to think about the exceptions and discuss with you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic