|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
3-Tier Binding Problem ?????????objects or usercontrols from other objects, example binding a usercontrol in the Presentation layer from a Business Layer Object, My problem: I have a Dynamically Rendered WebUserControl that it needs some properties that will control how this WebUserControl be Rendered. The information needed are found in a business layer Object. What I thought about is making both the WebUserControl and the Business Class share the same Interface. So that I can bind easly the properties of the Business Object to the Control. Is this kind of solution is possible ?? what is the smartest way to do it ?? Please help of you are able to layout a proposed solution to this problem or at least state some good guidelines it will be much appreciated. Best Regards, Sharing makes All the Difference I don't know the smartest way! Not sure I would use the interface
approach directly on a usercontrol. I prefer a Model View Controller pattern, maybe an additional facade class that can separate the presentation logic from the business logic? In the short term it is slower but over time your code will be easier to maintain... HTH ----------------------------------------- David Gray ASP.NET/C# Developer/Architect (MCAD.NET) On Thu, 12 Jan 2006 19:44:22 -0800, Dave Johnson <esharpco***@gmail.com> wrote: Show quoteHide quote >In a 3-Tier application, once upon a while comes the need for binding >objects or usercontrols from other objects, example binding a >usercontrol in the Presentation layer from a Business Layer Object, > >My problem: > >I have a Dynamically Rendered WebUserControl that it needs some >properties that will control how this WebUserControl be Rendered. The >information needed are found in a business layer Object. What I thought >about is making both the WebUserControl and the Business Class share the >same Interface. So that I can bind easly the properties of the Business >Object to the Control. > > Is this kind of solution is possible ?? what is the smartest way to do >it ?? > >Please help of you are able to layout a proposed solution to this >problem or at least state some good guidelines it will be much >appreciated. > >Best Regards, > > >Sharing makes All the Difference greetings david,
thnx for your reply but could you give more explanation on how you might solve this kind of problem and on what basis you have chosen this solution ? that might help, thanks alot! Sharing makes All the Difference Hi Dave,
In good tiered architecture, ignorance flows downhill. That is, the data layer knows nothing about the business layer. The business layer knows nothing about the presentation layer. This enables the data layer to be used by any business layer, and the business layer to be used by any presentation layer. The business layer must know something about the data layer (its programming interface) in order to use it. The presentation layer must know about the programming interface of the business layer in order to use it. So, don't modify the business layer to suit the presentation layer. Modify the presentation layer to suit the business layer. -- Show quoteHide quoteHTH, Kevin Spencer Microsoft MVP ..Net Developer You can lead a fish to a bicycle, but it takes a very long time, and the bicycle has to *want* to change. "Dave Johnson" <esharpco***@gmail.com> wrote in message news:u8sGlO$FGHA.608@TK2MSFTNGP14.phx.gbl... > In a 3-Tier application, once upon a while comes the need for binding > objects or usercontrols from other objects, example binding a > usercontrol in the Presentation layer from a Business Layer Object, > > My problem: > > I have a Dynamically Rendered WebUserControl that it needs some > properties that will control how this WebUserControl be Rendered. The > information needed are found in a business layer Object. What I thought > about is making both the WebUserControl and the Business Class share the > same Interface. So that I can bind easly the properties of the Business > Object to the Control. > > Is this kind of solution is possible ?? what is the smartest way to do > it ?? > > Please help of you are able to layout a proposed solution to this > problem or at least state some good guidelines it will be much > appreciated. > > Best Regards, > > > Sharing makes All the Difference > > -- > Sent via .NET Newsgroups > http://www.dotnetnewsgroups.com
Other interesting topics
File Download
Seeking examples of screen scraping.... Issue with ASP.NET 2.0 Global asax Help: ASP.Net broken (tried usual suspects...) Can't open asp xml page Question about string Error: 'CreateUser' is not a member of 'Membership' FormsAuthentication.SignOut() and User.Identity vs2005: domain trust relationship problem XMLHTTP question |
|||||||||||||||||||||||