473,387 Members | 1,504 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,387 software developers and data experts.

Data Oriented vs Object Oriented Design

Hi all,

New to .NET, I'm working on an Winforms client application using VS
2005 beta2. My needs considering data storage are the followings:

(1) Small files (0 < length < 10 mb), containing lots of small
'objects' that need to be loaded into memory at runtime, in order to
garantee small access time to each 'object'. Each of these 'objects'
collection should be able to easily bind to a DataGridView, AND to
provide *filtering* and *sorting* capability.

(2) 'Mid-large' files (0 < length < 100 mb), containing lots of
'mid-large objects'. Such files shouldn't be fully loaded in memory,
but the class that deals with those files must expose random
accessing/adding/removing/modifying 'object' functionalities.

In facts, a file of type (1) contains an index of the large 'objects'
contained in a corresponding file of type (2). Each index will be used
to fill a DataGridView, and each entry (row) will provide a
'reference' to the 'big object' stored in the corresponding type (2)
file (in addition to some other object-specific details that will be
displayed on the DGView of course).

Since this is a light Windows client application, using a database
with a data provider is out of the question.

Type (2) will be the subject of another post ("Dealing with large
files (random access)").

So let's talk about type (1):

My first thought was to use one or more DataSet objects to deal with
all of these. But as no data providers would be used, I said to myself
that considering a collection of objects would be better: thus I could
use serialization to store and retrieve usable objects, instead of
DataRows. So I took a look at the new C# 2.0 generics and found myself
pretty satisfied: the generic List<T> class provided in .NET 2.0
seemed to be perfect for my indexes (type (1)). Binding it to a (.NET
2.0) Windows.Forms.BindingSource, and then this BindingSource to my
DataGridView would then be just great, because (from MSDN):

"Sorting and filtering capability is exposed in the BindingSource
control through the Sort and Filter properties. Simple sorting can be
applied when the underlying data source is an IBindingList, and
advanced filtering and sorting can be applied when the data source is
an IBindingListView."

That was too easy: the only class implementing IBindingListView in
..NET 2.0 is DataView. Implementing it for a List<T> would be too much
work. So back to my first idea: I finally had to use a DataSet for my
type (1) files. IMHO, this is far from being the 'killer' approach.
Well, .NET 2.0 seem to have made a great progress by introducing a new
abstract layer for data binding: the BindingSource class. The UI is no
more directly tied to some data object. But there's still something
wrong: I constantly need a value object to do more things than just
reading and modifying my current entry. A DataViewRow, even if it
'represents' an entry, can't contain the smarts of an object.

To sum up:

* The OO generics approach provides usable objects but few sorting and
no filtering capabilities.
* The DataTable approach provides full sorting and filtering but no
usable objects.

I would be glad to read your comments about these thoughts. And
please, if I miss something about .NET data binding capability (or
other), tell me.

--
Patrick
Nov 17 '05 #1
1 3911
> * The OO generics approach provides usable objects but few sorting and
no filtering capabilities.
* The DataTable approach provides full sorting and filtering but no
usable objects.

I would be glad to read your comments about these thoughts. And
please, if I miss something about .NET data binding capability (or
other), tell me.

Your post is hard to place for me, but here are a couple of thoughts:

My advise would be to stay away from generics unless you have a compelling
reason not to. Many things generics can do can be accomplished with
non-generics too, in a far easier manner. For example, using a
System.ArrayList() instead of a list generic will save you a couple of
headaches.

A DataTable can contain pretty much anything, I don't see why you would
need a value object besides the DataTable, other than for performance
reasons.

This link was posted earlier as a nice introduction to the ADO.NET stuff:
http://samples.gotdotnet.com/quickst...aceHolder.aspx

Greetings,
Wessel
Nov 17 '05 #2

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

Similar topics

2
by: ggg | last post by:
I'm looking for a complete project/application done with heavy use of of object-oriented programming & design. Preferably something well documented and/or commented so that I can pick it apart...
1
by: Robert Hathaway | last post by:
COMP.OBJECT FAQ Version II Beta now Available http://www.objectfaq.com/oofaq2 ================================================== - Latest Important Information on Object Technology - What's New...
34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. ...
9
by: cryptic_blade | last post by:
I am working on the design for a new application and want to make the program fully object oriented. I have built and used C++ classes before, but never with a database driven application. Should...
8
by: Dale | last post by:
I've searched Amazon and read probably 100 reviews but can't find what seems to be any book that is widely accepted as the definitive book on object oriented programming design and techniques. And...
2
by: Random | last post by:
Here's a design question I'm curious to know if anyone here has wrestled with before... I'm writing my data access methods in classes in the App_Code directory. I know that I can easily...
46
by: ajba74 | last post by:
Hi fellows, I am reading some books to learn the C programming language, and sometimes I have the feeling that when somebody becomes a C expert, he must learn a more modern and object-oriented...
17
Motoma
by: Motoma | last post by:
This article is cross posted from my personal blog. You can find the original article, in all its splendor, at http://motomastyle.com/creating-a-mysql-data-abstraction-layer-in-php/. Introduction:...
5
by: girays | last post by:
I want to make a good design about combining information. Suppose you have different data types, and each may have semantically same data. I want to merge these different data types into a single...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
0
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...

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.