Exforsys

Online Training

observer implementation

This is a discussion on observer implementation within the Software Patterns forums, part of the Testing category; Hello chaps, wonder if anyone can help me out on how to implement the observer pattern. Scenario: I have a ...


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-07-2004, 09:10 AM
Adie
Guest
 
Posts: n/a
observer implementation

Hello chaps, wonder if anyone can help me out on how to implement the
observer pattern.

Scenario: I have a bunch of different products with different attributes
and I want to update the values of the products attributes. I select the
right class for the product using the Factory pattern, the product knows
which attributes belongs to it (database fields) for updates and displaying
etc...

Ok so I want to give a means of inputting data to the products attributes
depending on which product is selected - I only want to display certain
text boxes that correspond to the correct products attributes.

Now I thought an observer might do the trick with it looping through the
products attributes container and calling "update" on the corresponding
input (textbox), but a textbox has no input method so I would have to
encapsulate the textbox and its "visible" method to give it the "update"
fuctionality needed .. this seems awefuly long winded and overblown to me.

Alternatively I could just set the visible property to either true or false
from within the observer.

Does anyone have a better way of dealing with this sort of setup?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:41 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.