3-Tier Binding Problem ?????????

D

Dave Johnson

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
 
D

DavidG

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
 
D

Dave Johnson

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
 
K

Kevin Spencer

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.

--
HTH,

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.
 

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

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top