Business Object and User Interfaces

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would like to design my application with several different user
interfaces. I was thinking to create business objects with properties to
retrieve/set values and display them either in textboxes and/or labels. I
would like my user controls (Windows or Web) to have a property that I set
that points to the business object's property. How could I do that?
Or should I simply write a method that receives the business object and then
populates the various controls on the UI?

Any suggestion is appreciated.

Thanks.
Mike
 
Hi,

What I do is more like the second , I have a Client class along with another
set of classes, they are defined in a dll, this dll is included in two
projects. web & win , there the correct form/page instantiate the Client
class and populate its controls as needed.



cheers,
 
Hi,

Do you use a config file, or do you use the name of the various UI controls
to populate your controls' data? I presume that both your Win & Web controls
have the same name to avoid duplicate code?

Thanks.
Mike
 
Hi,

Neither one.

The business object just create a Client (for example) and then it's
responsability of who is using it to work with it.

So yes, practically you will have duplicated code, or in other word, two
different codes that do the same like "Show the client info to the user".
The thing is that a web app is a completely different from a win app. The
way you interact with the user is different, so it's very difficult to use
the same code for both of them.


cheers,
 
As others have suggested the business object is totally independent of
the user interace allowing you to reuse the business object with a web
or winform application. In this sense the business object is the Model.
A simple approach is to create a Controller class that owns the Model
and UI elements (View). On update the Controller polls the Model and
updates the View.

Regards,
Jeff
 

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

Back
Top