• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Observer-Observable question

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eugene,
I am wondering if you have seen this question???
Thanks,
Aruna.
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eugene,
Thanks for clearing that up!!
 
I'm so happy! And I wish to make this tiny ad happy too:
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic