Easy Data Object Relational Mapping Tool
Upcoming SlideShare
Loading in...5
×
 

Easy Data Object Relational Mapping Tool

on

  • 801 views

ORM Solution for MS .NET which supports MSSQL, MySQL and Oracle databases

ORM Solution for MS .NET which supports MSSQL, MySQL and Oracle databases

Statistics

Views

Total Views
801
Views on SlideShare
798
Embed Views
3

Actions

Likes
0
Downloads
2
Comments
0

2 Embeds 3

http://www.linkedin.com 2
http://10.150.250.21 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Easy Data Object Relational Mapping Tool Easy Data Object Relational Mapping Tool Presentation Transcript

  • EasyDataDeveloper Friendly Object-RelationalMapping Tool for Microsoft .NETHasitha Guruge2008/MCS/021
  • IntroductionWhat is “EasyData”? • “EasyData” is an open source, developer friendly Object-relational mapping tool for Microsoft .NET which has been developed based on C#.NET language. It enables developers to use it with databases such as MS SQL, MySQL and Oracle. Your Logo
  • Objectives Primary Objectives✓ 1 Develop an object-relational mapping tool with basic functionalities✓ 2 Support for Microsoft .NET Web/Windows Applications✓ 3 Ability to use inheritance and polymorphism and create hierarchies between entities✓ 4 Handle relationships such as 1-1, 1-n, n-1 and n-n✓ 5 Support for transaction based data operations 6 Support for Aggregations and SQL Grouping Secondary Objectives✓ 1 Support for multiple Databases (MS SQL, MySQL, Oracle) 2 Has its own Query Language (OQL)✓ 3 Support for Data Binding of components in .NET✓ 4 Easy configuration and relatively low learning curve Your Logo
  • DAL & ORMCore concepts behind the project • In Applications Data Access Layer is the layer which deals with data. • Object-Relational Mapping is one way to automate this DAL by reducing redundant work and higher risk of errors. • ORM Tools create a bidirectional link between relational database and objects in an application.
  • Related Projects Major tools based for the project - Open Source NHibernate - Complex Configuration - Huge Learning Curve - Mapped via XMLs - Multiple Database Support - Open Source Fluent - Extension to NHibernate NHibernate - Mapped without XMLs / Separate Mapping Layer - Complex Configuration - Huge Learning Curve - Open Source - Use Active Record Design PatternCastle Project - Based on NHibernateActiveRecord - Mapped without XMLs via same Entity Object - Since it is based on NHibernate, same disadvantages exist here as well Your Logo
  • Related ProjectsMicrosoft or Private Projects LINQ to SQL LINQ to SQL and ADO.NET Entity Framework Only with .NET Framework 3.5 or have their own limitations such as lack of 1 higher. DBML file provides the mapping functionality. support for MySQL and no support for the lower versions such as Framework 1.1, 2.0 likewise. ADO.NET Entity Framework nHydrate was a private project till Sep, 2009 Only with .NET Framework 3.5 or 2 higher. Uses Active Record pattern. and built on .NET Framework 3.5 to work exclusively with MS SQL Server. nHydrate Studied related work and extracted the important features to incorporate with EasyData. Uses Active Record Pattern in core 3 of DAL. Since it was a private project it is not so popular. Your Logo
  • ER Diagram to perform testing
  • EasyData DesignComponent Diagram – with extended features
  • ImplementationImplementation Process With Extended R & D Existing Features Tools With Basic Features Your Logo
  • How It Looks LikeSample Insert Method with Testing[Test]public void SimpleCreateTest(){ using (EasySession easySession = new EasySession()) { ///[Test Create] - without relationship ProductCategory productCategory = new ProductCategory(); int resultCount = productCategory.Count(easySession); Assert.AreEqual(4, resultCount); productCategory.Name = "Test Category"; productCategory.Rowguid = Guid.NewGuid(); productCategory.ModifiedDate = DateTime.Now; productCategory.Save(easySession); resultCount = productCategory.Count(easySession); Assert.AreEqual(5, resultCount); }} This is a sample code to tests the Save() functionality. The “ProductCategory” is a sample table that has many Sub Categories under that. The “easySession” responsible for the database connection and the transaction of the record insert. All executions within one session is handled under the same transaction. Simply create an instance of the object and assign values to the instance and simply call Save() function. Your Logo
  • EasyData HierarchyHow the components interact with each other? Code Behind Files public class ProductCategory Code Behind Files (aspx.cs or aspx.vb) { public class ProductCategory Code Behind Files (aspx.cs or aspx.vb) } { public class ProductCategory Configuration File (aspx.cs or aspx.vb) } { } public abstract class EasyDataBase<T> public class EasySession : IDisposable { { …………. …………. ……………. ……………. } } Object Query Classes public class EasySave<T> public class EasyUpdate<T> public class EasyDelete<T> public class EasySelect<T> { { { { …………. …………. …………. …………. ……………. ……………. ……………. ……………. } } } } DB Specific Library - MS SQL Custom Attributes - MySQL Database - Oracle
  • Scope of the ProjectInitial Scope Conduct a literature survey on existing and popular ORM tools which are used in .NET Framework and understand 1 their architectures , basic operations and features Implement a mapping tool with basic features such as CRUD operations with the support of relationships among 2 tables/entity objects Enhance the tool with new effective and flexible features as a separate R & D task 3 Test the tool using a sample common database or generated data from another mapping tool 4 Release the functional tool as a beta version to use with the developments of target users’ 5 Conduct a survey to collect and identify developer needs and feedbacks 6 Your Logo
  • Scope of the ProjectDeviations from the Initial Unable to go through the all features and functionalities of all popular tools due to their complexity and time 1 constraints Unable to build in-built functionalities to support all aggregation and grouping functions due to the time constraints 2 R & D Phase was dragged more than expected, due to the complexity and huge learning curves of existing tools 3 Unable to deliver the beta version on time and let it be tested by the target users, currently it is available for the 4 target users for testing The final survey is not conducted, since the developments were delayed and release of the beta version without 5 enough time to perform the testing by target users Unable to complete the OQL (Object Query Language) and its functionalities and is currently available as a basic 6 version towards that Your Logo
  • ConclusionThe final result The beta version of the implemented tool is available on http://www.future-needs.net/easydata Since it is an open source tool the windows binaries as well as the source is available online. A survey to collect developers’ expectations and experience with another popular tools is provided before download of the tool. Your Logo
  • Future EnhancementsSteps towards a stable & rich tool Implement object query language (OQL) as it is in an integrated query language (LINQ) 1 Implement more in-built functionalities to provide more flexibility in data selection 2 Build a standalone tool or integrated tools to generate entity class files with mapping related details by reading the 3 database tables and relationships Optimize the auto generated queries and the process of building queries to improve the performance of the tools 4 Implement a parameterized way to call functions which contains strongly typed variables for the different database 5 types instead of implementing the same method repetitively by checking the database type Implement a good library for different query languages which contains keywords, reserved words and special 6 scenarios for those languages to handle scenarios such as following SELECT TOP example. SELECT * FROM parts WHERE name = gearbox LIMIT 1; -- MySQL or PostgreSQL SELECT * FROM parts WHERE name = gearbox AND rownum < 2; -- Oracle SELECT TOP 1 * FROM parts WHERE name = gearbox; -- Microsoft SQL Server Your Logo
  • THANK YOU! Your Logo