T
Tomer Ben-David
Hello
I am going to write a generic event system to my application.
So did a little bit of investigation of ready made events mechanisms
in java and found these:
Section 1 :
java.util.Observable
java.util.Observer
They seem OK to me... Then I moved on to see some API of events in
servlets and noticed these guys:
Section 2 :
javax.servlet.http.HttpSessionListener
java.util.EventListener
My question is :
Why isnt there any connection between the classes/interfaces in
section2 to section1 isnt there actually a code duplication?!
(i.e. Isnt the listener in java.util.EventListener actually an
Observer?
Why do they have this duplicity?)
What should I use in case I want to have a generic events framework in
my system?
Thanks in advance,
Tomer
Thanks in advance
Tomer
I am going to write a generic event system to my application.
So did a little bit of investigation of ready made events mechanisms
in java and found these:
Section 1 :
java.util.Observable
java.util.Observer
They seem OK to me... Then I moved on to see some API of events in
servlets and noticed these guys:
Section 2 :
javax.servlet.http.HttpSessionListener
java.util.EventListener
My question is :
Why isnt there any connection between the classes/interfaces in
section2 to section1 isnt there actually a code duplication?!
(i.e. Isnt the listener in java.util.EventListener actually an
Observer?
Why do they have this duplicity?)
What should I use in case I want to have a generic events framework in
my system?
Thanks in advance,
Tomer
Thanks in advance
Tomer