By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,543 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,543 IT Pros & Developers. It's quick & easy.

Observer Design Pattern Extension

P: n/a
Since I couldn't find a OO design/architext forum, I thought I would post
here...

I have a win app with forms management. forms are grouped by category
(pertains to company, pertains to project. etc). This is represented, for
example, by a company window containing additional windows such as company
information, document history, yada yada. I am using the Observer/Observable
pattern to refresh all the forms in a group when another form is updated.
However, this is inefficient because most of the time, only a couple, or
somtimes no other forms need to refresh thier data. I thought about
refreshing each time the user moves between forms, but this is inefficient
because in most cases there is no need to refresh the data.

So the question is, does anyone know of a pattern that extends or uses the
Observer/Observable pattern to 'update' the Observer if and only if it needs
to be updated? I'm too damn lazy to write it myself and then go and write
the article on it, but I will if I have too =P

Thanks in advance
-dec
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

In your Observer, when it receive an update, it should determine itself
whether it need to be refreshed. If not, the observer just ignore it or
keep a state internally that allow it to update later when neccessary.

Also, you can use Subscribe/Publish pattern. The Observer subscribe to
the publisher that it interested in. So, only a subset of and relavant
forms get notified of the update.
decrypted wrote:
Since I couldn't find a OO design/architext forum, I thought I would post
here...

I have a win app with forms management. forms are grouped by category
(pertains to company, pertains to project. etc). This is represented, for
example, by a company window containing additional windows such as company
information, document history, yada yada. I am using the Observer/Observable
pattern to refresh all the forms in a group when another form is updated.
However, this is inefficient because most of the time, only a couple, or
somtimes no other forms need to refresh thier data. I thought about
refreshing each time the user moves between forms, but this is inefficient
because in most cases there is no need to refresh the data.

So the question is, does anyone know of a pattern that extends or uses the
Observer/Observable pattern to 'update' the Observer if and only if it needs
to be updated? I'm too damn lazy to write it myself and then go and write
the article on it, but I will if I have too =P

Thanks in advance
-dec


Nov 15 '05 #2

P: n/a
"decrypted" wrote:
Since I couldn't find a OO design/architext forum, I thought I would
post here...

I have a win app with forms management. forms are grouped by category
(pertains to company, pertains to project. etc). This is
represented, for example, by a company window containing additional
windows such as company information, document history, yada yada. I
am using the Observer/Observable pattern to refresh all the forms in
a group when another form is updated. However, this is inefficient
because most of the time, only a couple, or somtimes no other forms
need to refresh thier data. I thought about refreshing each time the
user moves between forms, but this is inefficient because in most
cases there is no need to refresh the data.

So the question is, does anyone know of a pattern that extends or
uses the Observer/Observable pattern to 'update' the Observer if and
only if it needs to be updated? I'm too damn lazy to write it myself
and then go and write the article on it, but I will if I have too =P

Thanks in advance
-dec


Hi,

there is a good OO newsgroup: comp.object. It should be available from
any good news server, e.g. http://news.individual.net/.
HTH,
Andy

--
To mail me directly, remove the NO*SPAM parts in
NO***********@gmx.netNO*SPAM
Nov 15 '05 #3

P: n/a
no no no...the refreshing of a window is depended on the changes that
occured in some other window. So coupling would be insainly high if the
object knew WHEN to refresh itself. It knows how to refresh itself and what
to refresh, but does not know when it should refresh due to the dedency on
another form.

I'll write the pattern and publish this weekend
-dec

"Jonathan" <da***********@yahoo.com> wrote in message
news:u4**************@TK2MSFTNGP12.phx.gbl...

In your Observer, when it receive an update, it should determine itself
whether it need to be refreshed. If not, the observer just ignore it or
keep a state internally that allow it to update later when neccessary.

Also, you can use Subscribe/Publish pattern. The Observer subscribe to
the publisher that it interested in. So, only a subset of and relavant
forms get notified of the update.
decrypted wrote:
Since I couldn't find a OO design/architext forum, I thought I would post here...

I have a win app with forms management. forms are grouped by category
(pertains to company, pertains to project. etc). This is represented, for example, by a company window containing additional windows such as company information, document history, yada yada. I am using the Observer/Observable pattern to refresh all the forms in a group when another form is updated. However, this is inefficient because most of the time, only a couple, or
somtimes no other forms need to refresh thier data. I thought about
refreshing each time the user moves between forms, but this is inefficient because in most cases there is no need to refresh the data.

So the question is, does anyone know of a pattern that extends or uses the Observer/Observable pattern to 'update' the Observer if and only if it needs to be updated? I'm too damn lazy to write it myself and then go and write the article on it, but I will if I have too =P

Thanks in advance
-dec

Nov 15 '05 #4

P: n/a
"decrypted" <de*******@earthlink.net> wrote in message
news:eu**************@TK2MSFTNGP09.phx.gbl...
Since I couldn't find a OO design/architext forum, I thought I would post
here...


Try comp.software.patterns too.

Marc
Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.