-
1. Re: Observable Pattern on the WIKI
marc.fleury Apr 16, 2004 6:25 PM (in response to adrian.brock)So I am looking at the code,
1- well done Adrian this is kick ass stuff
2- Why do we call it the "Subject"? why don't you call it observable.
3- We need to start talking of aspects. I realize we apply the "observable" aspect and introduce that behavior. That we introduce it on set is irrelevant, yet today the way to configure the XML. -
2. Re: Observable Pattern on the WIKI
adrian.brock Apr 16, 2004 6:50 PM (in response to adrian.brock)I used "Subject" because that is the term used by the GOF
-
3. Re: Observable Pattern on the WIKI
bill.burke Apr 16, 2004 6:59 PM (in response to adrian.brock)It should also be triggerable by an annotation.
<bind pointcut="set(* @observable->*)> ... </bind>
-
4. Re: Observable Pattern on the WIKI
bill.burke Apr 16, 2004 7:02 PM (in response to adrian.brock)Also, you can use annotations within the introduction.
-
5. Re: Observable Pattern on the WIKI
bill.burke Apr 16, 2004 7:10 PM (in response to adrian.brock)Sorry, one more thing.
THis should be extended to do more fine grain obervations. Not only field changes, but also method calls and such. Also, per field, per method, etc...
Also, it might make sense to not bind an interceptor at the class level, but rather bind the interceptor on a per-instance basis.
Bill -
6. Re: Observable Pattern on the WIKI
adrian.brock Apr 16, 2004 7:16 PM (in response to adrian.brock)Can you explain the annotation usage.
Is that doable now or do we have to code something? -
7. Re: Observable Pattern on the WIKI
adrian.brock Apr 16, 2004 7:23 PM (in response to adrian.brock)I already created this topic for Observable improvements
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=48622
Obviously dynamically adding/removing the interceptor is preferrable based on whether
{add/remove}Observer is invoked. But I didn't want to overcomplicate the initial
implementation. -
8. Re: Observable Pattern on the WIKI
marc.fleury Apr 17, 2004 10:44 AM (in response to adrian.brock)this is great work adrian,
Bill, I think what I hear you say is that we can now deploy a self contained aspect. The aspect knows where he wants to be bound. The aspect could export its pointcuts, he knows he wants to listen on set* etc. It will make for superior deployment formats for aspects. -
9. Re: Observable Pattern on the WIKI
marc.fleury Apr 17, 2004 10:48 AM (in response to adrian.brock)I hear you on the usage of Subject. I saw it is the way the GOF named it. I still prefer "Observable".
Getting at the state is done by passing the reference to the subject in your implementation. It makes for a great and simple implementation. If we could pass some metainformation as to what has changed (name of the field for example), it would make for more finegrained callbacks from the observer.
What does GOF say?
marcf -
10. Re: Observable Pattern on the WIKI
bill.burke Apr 17, 2004 10:50 AM (in response to adrian.brock)I'll have JDK 1.5 annotation support sometime next week in CVS. Doing another beta of JBoss AOP soon too.
-
11. Re: Observable Pattern on the WIKI
adrian.brock Apr 17, 2004 11:03 AM (in response to adrian.brock)GOF does it my way.
It would be trivial to write an alternate ObservableLight :-)
Transaction synchronization would also help to avoid multiple fine grained
fireChanged() events inside a transaction. Similar to JBossCacheAOP -
12. Re: Observable Pattern on the WIKI
bill.burke Apr 17, 2004 11:12 AM (in response to adrian.brock)this tx observable pattern is everywhere in Jboss
-
13. Re: Observable Pattern on the WIKI
spiritualmechanic May 5, 2004 8:21 PM (in response to adrian.brock)Looking at the Observable example on the wiki, I see
In the jboss-aop.xml.
Is "prepare" something that's in the 1.0Beta? I'm looking for it, but I'm thinking maybe this stuff is in HEAD.
Very cool stuff. I really enjoyed Marc's statement saying that the GOF behavioral patterns fit very well into an AOP implementation. That's some meaty stuff you don't see very often. -
14. Re: Observable Pattern on the WIKI
bill.burke May 5, 2004 9:45 PM (in response to adrian.brock)prepare is in Beta1, yes. It's in one of the WIKI sections