Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Observer-Observable question

 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eugene,
I was looking at the assignment requirements last night-
It specifically says
"The design should use standard Java package facilities whenever possible. Designs should not involve building new code if the effect can be safely achieved by using facilities in the standard JAva packages. Performance alone is not a justification for ignoring this"
Do you think the assessor will get irate because I am using my own Observer pattern rather than theirs?
My justification for creating my own would be that I need to know the updateType I am dealing with and their framework does not provide that.
There are ways to get around knowing the update type ( for example,looking at the object returned to the Observed in the "update" method) but I don't like them.
Thanks,
Aruna
Thanks,
Aruna
 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eugene,
I am wondering if you have seen this question???
Thanks,
Aruna.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Do you think the assessor will get irate because I am using my own Observer pattern rather than theirs?

No, you will be fine with your own Observer/Observable. The main problem with Java predefined Observer/Observable is that Observable is a class that you must extend. Therefore, if you model itself extends some other class, it cannot be Observable (no multiple inheritance in Java)! For that reason (and some others, that I mentioned in other posts), it is very common to reimplement this pattern.
Eugene.
 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eugene,
Thanks for clearing that up!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic