The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
3answers
86 views

Are EventHandler<T> and IObservable<T> interchangable?

I have an object which will periodically raise an event based on an action performed in an application. This will be heard by any listener(s) and acted upon accordingly. I do not wish to use a ...
2
votes
1answer
208 views

Any OOP design pattern that is somewhat representative of all of the SOLID OOP design principles at play?

I'm trying to teach an object oriented design principles course (on SOLID) at a training institute. I also want to teach the students a few OOP design patterns such as factory, singleton and one ...
0
votes
1answer
109 views

The Observer pattern using the pulling mechanism

I was wondering about the following implementation of public void update(Observable obs, Object arg) while i want to send to all of my observer and update using notifyObserver() i and passing a ...
1
vote
1answer
181 views

I'm always reimplementing observer/subject code in Java. Is there a better option?

I'm always writing observer/subject interfaces in a particular Java project, e.g.: /** * Registers the receiver to the dispatcher. * When data arrives that the receiver can process, * it will be ...
1
vote
1answer
104 views

Freeing Memory: Observer Pattern?

I am building a scientific application in matlab which handles several hundred large matrices (large as in 'very few of these will fit into ram'). Each matrix is contained within a dedicated object to ...
5
votes
2answers
247 views

Was .NET's IObserver<T> intended for subscribing to multiple IObservables?

There are IObservable and IObserver interfaces in .NET (also here and here). Interestingly, the concrete implementation of the IObserver does not hold a direct reference to the IObservable. It ...
3
votes
2answers
137 views

UML class diagram: how to annotate observer-subject relationship?

How can I annotate in a UML class diagram that an instance of ClassA is registered as an observer of an instance of ClassB? (Both implement the appropriate interfaces). This doesn't really belong in ...
1
vote
0answers
67 views

Observing multiple observables at once / Network of chained observers

Quick example: HM observes CM SM observes CM HSM observes HM and SM, but wants to be updated only after both have their new value derived from CM. More detail: (this is still a made-up example, ...
0
votes
1answer
199 views

Observer pattern: “Web of observers” - Is this ever in use?

I had an idea (which I'm sure already exists), to create a sort of 'network of observers/subjects'. I would like to describe how it works and than ask several questions about it. Say we have 5 ...
2
votes
3answers
249 views

How does Observer create loosely-coupled design?

I completely understand the Observer design pattern, what it is for and how to implement it. I also understand what the term 'loosely-coupled' means. But I'm not sure how Observer makes designs more ...
0
votes
2answers
130 views

Is there a way to not use the Observer pattern when creating GUI systems?

In Java, the Swing library implements the Observer/Subscriber-Publisher design pattern to design the way the program responds to events on the GUI (button clicks, etc). The programmer registers ...
1
vote
3answers
149 views

Does this in the Observer pattern count as composition?

In a classic implementation of the Observer design pattern, the subject has a list of references to all of it's observers, and each observer might have a reference to it's subject. Is this considered ...
3
votes
1answer
110 views

Testing: Should I wrap system notifications and send my own?

In the current Cocoa app I'm working on, I've got an object, RecordScheduler, which responds to two types of notifications, "day did pass" and "quicksaving interval did pass". In both cases, the ...
2
votes
2answers
150 views

observer class as instance

Sometimes I read in oberver-pattern descriptions, to make the constructor of a observer base class protected so the class will be abstract. but by making the constructor public (if even one is ...
3
votes
3answers
2k views

Which design pattern is more suitable for logging?

I should log some events in a program but as far as I know it would be better to keep the logging code outside the program because it is not about the real functionality of the program. So may you ...
1
vote
1answer
154 views

how to model a connection to a resource, with rudimentary event processing

For my simple MUD client I'm using Apache Telnet (no, not ssh). A mud client is a strange beast: Generally, a MUD client is a very basic telnet client that lacks VT100 terminal emulation and the ...
4
votes
1answer
661 views

Design patterns for multi-threaded messaging server

I'm designing an instant messaging server as a personal exercise to improve my understanding and application of multi-threading and design patterns in Java. I'm still designing, there's no code yet. ...
3
votes
1answer
225 views

Mutual observer pattern in Java

I want to improve my multi-threading and design pattern skills. As such I'm designing an Instant Messaging server. I'm writing the Server first. My plan so far is to have Client "Proxy" Classes to ...
4
votes
2answers
428 views

Publish/subscribe, observer pattern implementation question

I'm developing desktop application in java/swing. I have a component that is registered as a subscriber to many panels and gets messages (my custom event) from them. That component is something like ...
2
votes
3answers
439 views

Is the Observer pattern adequate for this kind of scenario?

I'm creating a simple game development framework with Ruby. There is a node system. A node is a game entity, and it has position. It can have children nodes (and one parent node). Children are always ...
2
votes
3answers
599 views

Automatically observing changes in database tables

currently I'm working on a project with the following setting: There is a proprietary application which performs transactions on a Microsoft Access database (which is actually stored as an .mdb ...
3
votes
4answers
515 views

Are Compiler Directives an Antipattern?

I'm working on a legacy system that has a helper class that is symbolically linked into many different .Net projects within a solution. The logic is riddled with compiler directives that change it's ...
1
vote
3answers
557 views

Is this Observer variant an improvement?

In a C++ code base I've been working on, they have a bunch of instances of the observer pattern, but it's a little different from the classical pattern. In the classic, the Observer is a specific ...
3
votes
2answers
267 views

Is there a design pattern for chained observers?

Several times, I've found myself in a situation where I want to add functionality to an existing Observer-Observable relationship. For example, let's say I have an Observable class called ...
5
votes
5answers
5k views

What are the advantages of the delegate pattern over the observer pattern?

In the delegate pattern, only one object can directly listen to another object's events. In the observer pattern, any number of objects can listen to a particular object's events. When designing a ...
0
votes
2answers
407 views

Access functions from user control without events?

On some generic functions, it seems that accessing a function on mainform directly from the usercontrol is easier than raising an event. For example: A function on main form that displays one desired ...
1
vote
1answer
131 views

Observer pattern for unpredictable observation time

I have a situation where objects are created at unpredictable times. Some of these objects are created before an important event, some after. If the event already happened, I make the object execute ...
5
votes
3answers
596 views

Design Patterns for Coordinating Change Event Listeners

I've been working with the Observer pattern in JavaScript using various popular libraries for a number of years (YUI & jQuery). It's often that I need to observe a set of property value changes ...
3
votes
3answers
294 views

Optimal communication pattern to update subscribers

What is the optimal way to update the subscriber's local model on changes C on a central model M? ( M + C -> M_c) The update can be done by the following methods: Publish the updated model M_c to ...
5
votes
2answers
760 views

Designing web-based plugin systems correctly so they don't waste as many resources?

Many CMS systems which rely on third parties for much of their code often build "plugin" or "hooks" systems to make it easy for developers to modify the codebase's actions without editing the core ...
5
votes
1answer
3k views

Observer pattern; knowing *what* changed?

I've created two abstract classes Subject and Observer that define a classic Observer pattern interface. I derive from them to implement the Observer pattern. An observer might look like this: void ...
4
votes
2answers
1k views

Observer pattern over HTTP and TCP/IP (Server-Client)

I have a server and many clients (around 50 clients) who connect to that server based on a web application, which is of course based on HTTP protocol, which in turn uses TCP/IP (correct me if I'm ...