473,761 Members | 8,011 Online
Bytes | Software Development & Data Engineering Community
+ 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 1938

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***********@g mx.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******** ******@TK2MSFTN GP12.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*******@eart hlink.net> wrote in message
news:eu******** ******@TK2MSFTN GP09.phx.gbl...
Since I couldn't find a OO design/architext forum, I thought I would post
here...


Try comp.software.p atterns too.

Marc
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3151
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 from it. During run time, using a static method, the class creates an instance of the derived class using the Activator class and returns it. This design pattern is very similar to the design pattern applied by the Assembly class. The twist is...
11
4308
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. They are still online at http://www.fluffycat.com/java/patterns.html Since September 2003 I've mainly been using PHP, and now that PHP 5 is becoming more available I am going to try the same thing I did in Java with PHP.
12
3039
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 itself. The called class has special functions for each class that can call it. With the visitor pattern, the calling class can have new operations added without being changed itself.
4
2878
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 for you. This one is pretty straight forward. In the Command Pattern an object encapsulates everything needed to execute a method in another object. http://www.fluffycat.com/SDCMSv2/PHP-Design-Patterns-Command/
22
4739
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. Also describes implementation via ChangeManager (Mediator + Singleton) 2) Pattern hatching by John Vlissides Describes Observer's implementation via Visitor Design Pattern. 3) Design Patterns Explained by Alan Shalloway and James Trott
1
937
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 the station) ServerClient stores one or more ServerObjects which house a list of StationObjects (all the stations attached to the server) I guess there would be RequestStationID and RequestSessionID methods that would create a new Station/Session...
4
4680
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) Generic observer design in C++. I have been pushing the Austria "Twin" interface for a while and more recently the multi threaded version of it "TwinMT" (see the 6129 alpha on sourceforge)
1
1679
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 will appreciate the answer
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10136
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9988
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9923
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3911
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 we have to send another system

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.