473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Business Object and User Interfaces


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


Nov 17 '05 #1
4 1609
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...

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


Nov 17 '05 #2

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

"Ignacio Machin ( .NET/ C# MVP )" wrote:
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...

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



Nov 17 '05 #3
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...

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

"Ignacio Machin ( .NET/ C# MVP )" wrote:
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
>
> 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
>
>
>
>
>
>


Nov 17 '05 #4
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

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marc Scheuner [MVP ADSI] | last post by:
Folks, Has anyone done this before? (I'm sure some of you guys have) I'd like to make sure our business objects and collections thereof are created in such a way that we can connect them to a...
25
by: Stuart Hilditch | last post by:
Hi all, I am hoping that someone with some experience developing nTier apps can give me some advice here. I am writing an nTier web app that began with a Data Access Layer (DAL), Business...
2
by: ulrich schumacher | last post by:
Hi ASP.NET 2.0 Professionals, I've got a question concerning the new ASP.NET 2.0 DataBinding with object oriented business classes: Example: There are two business classes in my domain...
3
by: Furty | last post by:
Hi, I'm looking for the best practice for creating a generic data validation implementation for my data bound business objects. I currently have a business object base class implementing the...
16
by: MS newsgroup | last post by:
I don't have clear reasons why we need business logic layer and data logic layer instead of having only data logic layer. Are there any good reasons for that?
8
by: morleyc | last post by:
Hi, until recently i was quite happy to add data sources from mssql database in visual studio and drag the datasets directly onto the form this creating a directly editable form which worked well....
8
by: Charles Law | last post by:
This is a sort of pattern question, but relating to how components are coupled in a three-tier system. I have a presentation layer, business layer and data access layer, the first is the EXE,...
12
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a...
4
by: jehugaleahsa | last post by:
Hello: Is it me, or is handling the Validating event for every control on a form extremely annoying? It is especially annoying when my business logic repeats most of the validation. Some things...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.