Seeking Advice on MVC Synchronization

G

Guest

Following the advice of several of you on here (Thank You All!) I've
successfully constructed a Model-View-Controller (MVC) implementation. It
works great! Now, whenever the user manipulates one of the standard controls
- ie. clicks a checkbox, selects a radio button, changes text in a textbox,
etc. - the corresponding Property values in the Model are automatically and
instantly changed!

But I do have a question. When a radio button is pressed or a checkbox is
checked or unchecked it makes complete sense to instantly reflect the change
in the Model. But I'm not so sure whether I should be making these same
"instant" changes with each character change of the TextBox. Should I or
should I just wait until the user exits the textbox?

I realize that an instant response is "it all depends" but I'd like to get
feedback from developers who have had a similar circumstance before and am
wondering how they handled it.

Sincerely,

Robert Werner
MW Technologies
Vancouver, BC
 
R

Radek Cerny

Firstly well done on deciding to use the MVC model. The answer is pretty
simple in my mind - always do it on commit of a change, that is on lose
focus. Also, I assume this is a Winforms implementation, so the
character-at-a-time metaphor does not map to a browser deployment.

FYI, interesting whitepaper on software development that has total
separation of presentation from business layer (and more):
http://members.optushome.com.au/rcerny/GenieWhitePaper.pdf
 
G

Guest

Thanks, Radek. Moving from the VB6 universe I didn't realize how difficult
it ended up being (read "steep learning curve") but now that I've done it I
feel a lot better about C# and dotNet in general. Powerful stuff!

I'll read your paper shortly.

Thank you again,

Robert W.
 
R

Radek Cerny

Robert, be careful to not mistake or confuse good design with OOP and code
reuse. OOD is whats important - Object Oriented Design. Think OO, draw
lots of pictures and clarify what goes where BEFORE a mass coding exercise.
OOP and code reuse are by-products of OOAD, and luckily c# gives pretty much
all you need to implement good OO design (except one major flaw - in my mind
anyways - no multiple inheritance or MI).

You'll probably think you've done a good job, but 6 months later realise a
much better way, and rebuild. Third generation will be great, 4th gen will
be fantastic and there may not be a 5th generation. By then however, you
will be extremely productive and your design artefacts will be far more
valuable than your code, so a rebuild will be not that painful.

Very powerful stuff indeed....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top