What is OJVB
-
OJVB is a purely object oriented design approach to provide .NET application
developers a Typed DataSet like class framework.
-
OJVB has a built in support for dynamic object joining and customable data view
creation, which is able to bind to Window Form DataGrid and Web Form DataGrid.
-
With OJVB, you can design distributed application with one data model to
prevent using custom objects for business processing and DataSet for
DataBinding in presentation view. OJVB allows you to design application
architect more easily and compliant with MVC principle better.
-
With single simple data model and one set of data, OJVB will reduce system
memory usage to avoid duplicating data among your components. The powerful
run-time object joining and view generation features of OJVB allows you to
create views at run-time with existing business data without additional data
base join queries. Obviously, OJVB will improve application performance.
-
OJVB is built to support distributed application. It outperforms DataSet in
.NET Remoting with excellent object serialization and deserialization. OJVB
also supports XML Web Service.
-
OJVB comes with a handy CodeGenerator to create all the OJVB enabled business
data objects based on the database tables that have been selected, which will
reduce developer a lots time to create these data classes with many Get/Set
Properties and other OJVB required functions.
-
A complete sample application with source code is provided to demo how OJVB
works for Windows Application, ASP.NET Web Application, ASP.NET WebService and
.NET Remoting Application. With this remoting demo, you can discovery the
performance advantage of OJVB over DataSet.
Why OJVB
-
OJVB has better performance than .NET DataSet in distributed application and
will be a good fit for data model across different layers
-
OJVB is easy to use because of its Object Oriented Approach, easy to integrate
with other systems.
-
OJVB provides a flexible Object JoinView capability to make it a very
attractive fron-end view factory.
-
OJVB CodeBuilder will help developer to create basic business data classes
directly from database.
-
OJVB can interoperate with JAVA in XML Web Service.
How to use OJVB
OJVB is very simple to use. You just need to refer the framework library
CyberDSI.OJVB.dll within your projects. By default, CyberDSI.OJVB.dll is
distributed under 'Bin' folder of the zip file.
You can also refer the OJVBDemo Solution for the details implementation. To
create your own business data classes and Data Access Classes, you can use
CodeBuilder, which is located in 'CodeBuilder' folder.
OJVB Infrastructure
Object Joining, View and Binding (OJVB) is a .NET framework trying to bring the
power of DataSet DataBinding and OO design features together for application
developer to build Distributed Microsoft .NET Window and Web applications. It
allows easy integration with existing .NET projects, its lightweight and
efficient data structure allowing fast data accessing, querying and sorting,
better binary serialization/deserialization than DataSet will all make OJVB a
good data model for today’s distributed .NET applications.
Figure 1
OJVB Architect
OJVB has following main parts.
-
1). IJoinData Interface. This is a marker interface with one data changed
event. Every custom business entity must implement this interface.
-
2). JoinDataSet Abstract Class. This is a base collection class to hold a list
of IJoinData and implements IComparer for data sorting and searching. For each
custom business entity that is derived from IJoinData, there must be a
corresponding concrete JoinDataSet class. Only one method, NewJoinData,
developers must override it.
-
3). JoinDataView Class. This is the class provides all the mechanisms to join
multiple custom business entity collections into a bindable datasource.
-
4). JoinDataRelation class. This is the glue to link a child JoinDataSet with
parents JoinDataSet.
Performance Test
A Remoting Test is created with following conditions:
-
Remoting Server: Window 2003 Server.
-
Remoting Client: Window XP professional.
-
Remoting Configuration: tcp and binary serialization.
-
Remoting Test Data: Northwind [Order Details]. All data are cached in server,
so that test result is purely due to the object serialization and
deserialization.
-
Remoting Test Case: DataSet vs OJVB List (OderItem in OrderItemList) vs Simple
(OrderItem in ArrayList) ArrayList.
-
The results: for passing a record size upto 5000, OJVB has at least 1/3 of
performance advantage.
Figure 2
OJVB Performance Test Result
Special Features
-
1). Simple and easy to use. There is only one marker interface and one abstract
class, plus one concrete JoinDataView class and a couple helper classes.
-
2). Supports Data Filtering. Developers can define the filter when creating the
JoinDataView so to limit the data to a small subset and increase the
performance.
-
3). Supports Window and Web DataGrid sorting. Sorting the JoinDataView is very
easy in both Window and Web application. Developers just need to provide the
sort column name.
-
4). Supports Multiple Parents Join. You can join as many parent collection sets,
as you like to the same child data collection.
-
5). Supports Add, Update, Remove for both JoinDataSet and JoinDataView. The
changes made on the data will immediately update the datagrid of window
applications.
-
6). Supports DataSet like GetChanges method to return only a subset of changed
data.
-
7). Supports binding to any componments with BindingContext property, such TextBox, DropdownList and ListBox.
Bugs AND Limitations
-
1). Filtering doesn't support wildcard operation and other complex filtering.
-
2). Sorting only supports single field.
-
3). The order of JoinDataRelation array must be the same as parent JoinDataSet
array when creating the JoinDataView.
-
4). Doesn't support auto increase of JoinDataSet primary field.
Installing the Software and Configure sample application
Installation is very simple. Just follow the setup prompts. Following folders
will be create under [Installation Root], they are:
-
\bin - contains binary code for OJVB framework.
-
\demo - contains a demo .NET solution(windows,web,webservice,remoting).
-
\doc - contains a API document and this readme.doc.
-
\codebuilder - contains a window application to create OJVB implementation
business entities from database
To run the sample asp.net web application, you need to create a web application
with IIS, name the application 'Northweb', the directory is
OJVBDemoApp\NorthWeb under your installation root. Modify the web.config or
app.config 'ConnectionString' setting with your own database connection values.
Sample Application
There are two sample applications are provided with installation. One is Window
Application, another is ASP.NET web application.
The sample applications are followed Microsoft Enterprise Distributed .NET
application design patterns.
The ASP.NET web application also implement a simple cache manager to show how
to improve application performance. The sample applications use some code from
Microsoft Building Block, such as Microsoft.ApplicationBlocks.Data for Data
Access, sqlHelperExtension.cs. Microsoft VB.NET JoinView is also included as a
separate project for comparison.
The web application also include two webforms to test Microsoft VB.NET JoinView
binding and DataSet binding.
A complete .NET Remoting Demo application using OJVB also included in this
distribution. To run the remoting demo, you also need to configure the
app.config in server project with correct data base connection.
Run server.exe first, then client.exe.
Figure 3
OJVB Demo Application Architecture
Using CodeBuilder
<
Figure 4
OJVB CodeBuilder Application
-
1) enter database server name and login, or you can check SSPI, then click
Connect button
-
2) Select a database you want to use
-
3) Select a table
-
4) Select columns or click 'All Columns' if ou want to include all the data
columns in your class
-
5) Click Add Column Button to add the table with selected columns
-
6) Select a column from the Selected Columns List Box, right click to set it as
primary field. You can only select one column for primary key.
-
7) You can modify the class and class collection name, default will use table
name as Class name and TableName + "List" as Collection Name.
-
8) Click Save to save all your selection into XML file
-
9) Or Click Create Button to create all the classes files
-
10) You can also modify the out folder, default namespace.
-
11). You can also let CodeBuilder to create basic data access classes for you
so that save your time to write code load data from database into your
collections.
-
12) If you want the your business data editable and let datagrid be notified
any data changes (new, update, delete), you should check 'Editable' option
before create the code.
Contact Us
Chang Liu
changliu@cyberdatastrategy.com
Cyber Data Strategy
©2005 Cyber Data Strategy. All rights reserved.
License