Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2008

Tip: Looking for answers? Try searching our database.

Use of Data Binding while using Model View Presenter pattern

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 03 Jan 2008 17:47 GMT
Does use of the model view presenter pattern negate using data binding on
controls?  I believe with this pattern that the view only knows about the
presenter.  By using data binding (controls on the view to data in the
model), the view would have to access the model as well.  

Am I right?  Should I avoid using data binding when implementing the MVP
pattern?  
Signature

Thanks,
David.

Bob Powell [MVP] - 04 Jan 2008 23:05 GMT
Don't confuse MVP with MVC. The presenter is often the ideal target for
databinding.

Remember that the presentation system may not necessarily be the UI. For
example, take the idea of a bank account with a positive or negative
balance. The number representing the balance may be a floating point value
that has no notion of colour yet, when viewed in the UI, the number will be
black or red depending on the sign. The presenter might provide a colour
property that changes with the sign of the balance and which is databound to
the ForeColor of the textbox used to display the number.

I personally believe that data-binding is the single most important
technology in the developer's toolbox today. Just consider the change to WPF
for example. Almost every aspect of application development has changed from
the Windows Forms model _except_ databinding which has been made more
robust, performant and powerful.

The short answer is "Yes, by all means use databinding between the presenter
and the view. Its the best method!"

Signature

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

> Does use of the model view presenter pattern negate using data binding on
> controls?  I believe with this pattern that the view only knows about the
[quoted text clipped - 3 lines]
> Am I right?  Should I avoid using data binding when implementing the MVP
> pattern?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.