d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Suggestions For Observ Pattern Example
Add Reply New Topic New Poll
Member
Posts: 27,185
Joined: Apr 16 2007
Gold: 161,690.00
Oct 21 2013 03:58pm
Topic title says it
I'm obliged to write an example for an observer pattern.
In c# and with Windows Forms.

But momentarily I'm struggling with a creative idea to implement.

If you have something really nice and dandy I will not hesitate to donate you :)
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 21 2013 05:19pm
have one app listening to a port for UDP/TCP. when it gets something, it notifies 10 other apps.

or replace apps with threads. or whatever.
Member
Posts: 27,185
Joined: Apr 16 2007
Gold: 161,690.00
Oct 21 2013 11:39pm
Quote (carteblanche @ Oct 22 2013 12:19am)
have one app listening to a port for UDP/TCP. when it gets something, it notifies 10 other apps.

or replace apps with threads. or whatever.



Sounds good, however it doesn't need to be that complicated I guess.
I was more thinking of a table being able to change the scales and displaying a relation that might be asociated with a weight or currency.

Anything on a similar level, being creative and easy to understand, that's what I'm looking for :)
Member
Posts: 16,218
Joined: Sep 27 2009
Gold: 13.00
Oct 30 2013 05:18am
Hm, with windows form i'll probably be like this :


You have your view (form 1) who has a reference on its controller and its model. You nearly do nothing in your view, just execute controller action when you click on a button or w/e.
In your model, you'll have all your data and the functions that modifies them.
Controller will do all the actions on the view.

View will only call functions from controller.

Simple exemple could be a registration manager or something like that.

This post was edited by Bremen on Oct 30 2013 05:20am
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll