473,473 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Observer Design Pattern Extension

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
4 1916

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
"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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Omer van Kloeten | last post by:
The Top Level Design: The class Base is a factory class with a twist. It uses the Assembly/Type classes to extract all types that inherit from it and add them to the list of types that inherit...
11
by: FluffyCat | last post by:
In Febraury - April of 2002 I put together in Java examples of all 23 of the classic "Gang Of Four" design patterns for my website. Partly I wanted to get a better understanding of those patterns....
12
by: FluffyCat | last post by:
New on November 28, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Visitor Pattern. In the Visitor pattern, one class calls a function in another class and passes an instance of...
4
by: FluffyCat | last post by:
New on November 29, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Command Pattern. Since you all enjoyed the Visitor Pattern so much yesterday, today I have the Command Pattern...
22
by: Krivenok Dmitry | last post by:
Hello All! I am trying to implement my own Design Patterns Library. I have read the following documentation about Observer Pattern: 1) Design Patterns by GoF Classic description of Observer....
1
by: techstyled | last post by:
I need to create the following framework: SessionClient stores one or more SessionObjects StationClient stores one or more StationObjects which houses a list of SessionObjects (all the sessions on...
4
by: Gianni Mariani | last post by:
Two issues here: a) What is the accepted definition of "observer pattern". While I can't point to anything specific, I do remember having issues with inconsistency in the definition. b)...
1
by: Walter Thizo | last post by:
Hi developers i am busy with the course OO analysis and design ,so my problem is i don't understand design pattern such as Singleton,Adapter and Observer anyone with practical explanation ,i...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.