473,770 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dataset and custom classes

I have written as a test a customer class that has all the necessary field
handling and formatting routines in it that I need. I have dataaccess class
that controls reading and writing the class into the database. However, I
am now getting to the user interface layer and a little confused as to where
to head next.

What I would like to do is somehow attach my class to a dataset or something
that would make it easy to read and write data into my classes without the
programming having to manually write get and set routines for each and every
field on the form.

Can anyone offer any suggestions as to the best way to handle this? I want
to try to keep my business layer as far away from the UI as possible but
want to provide easy methods for the UI programmers to use when they are
attaching to my classes.

Thanks,

glenn
Nov 16 '05 #1
1 1647
Hi,

What do you mean by field handling and formatting?

Formatting, as a general rule, should be a responsibility of the UI layer,
but not of a business entity object. Handling can mean different things - if
you assume enforcing certain business rules, the business entity object is
the right place.

In general, a kind of rule of thumb I've seen in the Microsoft Patterns and
Practices is - if your business object is merely a data holder, use a typed
DataSet instead. Otherwise, if you encapsulate business rules, validations
or things like that, use a class.

Finally, if your business entity is a custom class, you still can use
databinding. I am not sure this type of databinding is supported in the
Windows Forms designer (probably it is provided you add proper attributes to
the business class' public properties), even if it is not - you can create a
number of DataBinding objects manually to link the class properties to the
controls on the form.

Hope this clarifies things a bit.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"glenn" <gh******@softe ksoftware.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
I have written as a test a customer class that has all the necessary field
handling and formatting routines in it that I need. I have dataaccess
class
that controls reading and writing the class into the database. However, I
am now getting to the user interface layer and a little confused as to
where
to head next.

What I would like to do is somehow attach my class to a dataset or
something
that would make it easy to read and write data into my classes without the
programming having to manually write get and set routines for each and
every
field on the form.

Can anyone offer any suggestions as to the best way to handle this? I
want
to try to keep my business layer as far away from the UI as possible but
want to provide easy methods for the UI programmers to use when they are
attaching to my classes.

Thanks,

glenn


Nov 16 '05 #2

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

Similar topics

8
19544
by: Dan Keeley | last post by:
Hi, I have a dataset which is used to populate my datagrid something like this: My question is, how do I add a caluclated display column to the datagrid? It will be based on ScoreCardScore... Dim Cmd As OleDbCommand = New OleDbCommand("Select AuditDate, ScoreCardScore, DetailsScore from Audits where SupplierID = " & ComboItem.Value.ToString, conn)
0
1053
by: m.roello | last post by:
Hi, Anyone can tell me how to define different custom namespaces for xsd datasets in ASP.NET web sites For example, Suppose to have the above folder tree in the App_Code directory App_Code --->Orders --->Customers
13
2367
by: Maxwell2006 | last post by:
Hi, We are having a debate over using DataSet as return value type for web services. The problem is that we don't know whether Java applications can use DataSet
5
3486
by: Simon Woods | last post by:
Hi Does anyone know if there any dotnet software out there which converts a dataset into a collection of custom objects, programmatically i.e. actually creates the class structure and collection class on-the-fly based on the fields in the dataset and then creates and populates the classes and adds them into the collection. Thanks
0
9591
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.