Observer-Observable question
posted 22 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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
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 A. Raghavan<br />SCJP, SCJD, SCWCD
Aruna Raghavan
Ranch Hand
Posts: 194
posted 22 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Eugene,
I am wondering if you have seen this question???
Thanks,
Aruna.
I am wondering if you have seen this question???
Thanks,
Aruna.
Aruna A. Raghavan<br />SCJP, SCJD, SCWCD
posted 22 years ago
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.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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
posted 22 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Eugene,
Thanks for clearing that up!!
Thanks for clearing that up!!
Aruna A. Raghavan<br />SCJP, SCJD, SCWCD
| 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 |









