Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / October 2007

Tip: Looking for answers? Try searching our database.

What is custom object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TonyJ - 24 Oct 2007 10:19 GMT
Hello!

Can somebody explain what custom object means which is mentioned in the text
below.

The alternative to using DataSets is to create custom object types that
represent your business entities, and custom collection types to contain
them. When you go this route, you end up needing to write a lot more code
yourself. This has gotten a lot better in Visual Studio 2005 and .NET 2.0
with the additions of code snippets and generic collection classes. But to
support the full range of features that a DataSet provides, there is still a
fair amount of custom code that you will need to write by hand.

//Tony
Marc Gravell - 24 Oct 2007 11:20 GMT
public class Customer {
 public int Number {...}
 public string Name {...}
 ...etc...
}

Note that the entity approach is well suited to ORM tools like LINQ
and NHibernate, and makes it easier to expose the entities as fully-
defined types for web-services etc. DataSet uses an adapter pattern;
advantages to both. Personally I prefer an entity approach as it feels
a lot more object oriented. And I'm a control freak.

Marc
Göran Andersson - 24 Oct 2007 14:00 GMT
> Hello!
>
[quoted text clipped - 8 lines]
> support the full range of features that a DataSet provides, there is still a
> fair amount of custom code that you will need to write by hand.

The custom object type would be a class that represents a record in the
data table, and has properties that correspond to the fields in the
table. The custom object would contain the same data as a DataRow does
in the DataSet.

Signature

Göran Andersson
_____
http://www.guffa.com

sloan - 24 Oct 2007 18:36 GMT
Here is a blog entry, with downloadable code:

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!140.entry

I have a 1.1 version of this article as well, which I would look at too.

I have a comparison between strong datasets and custom objects... and you
might be surprised by the time it takes to load them.
See 1.1 example for more info.

PS

These days, I go ahead and define a collection object like this

public class OrderCollection : List<BusinessObjects.Order>
{
//yeah, that's all there is to it.
}

You'll know what I"m talking about if you download and go through the code.

> Hello!
>
[quoted text clipped - 12 lines]
>
> //Tony
sloan - 26 Oct 2007 18:45 GMT
This article will explain it all.

http://msdn2.microsoft.com/en-us/library/ms978496.aspx

What they are, and contrast to other methods.

> Hello!
>
[quoted text clipped - 12 lines]
>
> //Tony

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.