473,385 Members | 1,409 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,385 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 3910
> * 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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?

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.