Click here to Skip to main content
Licence CPOL
First Posted 5 Nov 2007
Views 24,251
Downloads 249
Bookmarked 26 times

Build Data Access Layer and Entity Layer in 20 Seconds

By | 5 Nov 2007 | Article
Give the Oracle Connection string and Get the DAL and Entity Layer in 5 steps
Screenshot - Demo.jpg

Introduction

The small utility tool has been developed for rapid development of Data Access Layer and Entity Layer.

I am a Software Programmer and I have to make Data Access Layer and Entity Layer for the procedures I made in Oracle. For each parameter in Procedure, I have to create a property with get and set in Entity Layer Class and have to build oracleParameterCollection in DAL. For the procedures that have 30 to 40 parameters, I have to code around 600 lines, which is very boring and time consuming.

I decided that most of the things of DAL and Entity layer are static, only the property and variable name change, why can I loop through each parameter of Procedure and make code string for every parameter.

So, my first problem is how to get all the procedure names and then all the parameter names of procedure. I found SQL Queries for that and also found .NET method of our OracleConnection class, obj_Connection.getSchema() which gives us all the data about the current connection with current Oracle schema.

Finally the application has been developed and now you can make your DAL and Entity Layer within 20 seconds in 5 steps.

You just need to give your connection string.

Select the Procedure, click on make Entity, Make DAL Button and you will get the code.

You can directly save Entity and DAL as .cs file.

Background

The Setting menu available in the application allows you to set Prefix and Suffix of variables and properties that are generated in the application automatically.

Using the Tool

  1. Paste your Oracle Connection string and Click the Set Connection String Button, which will show you all the procedures of the current schema.
  2. Select the procedure you want to make DAL and Entity layer for and click the Get Parameter Button. It will show you all the parameters with its DataType and Input/output type.
  3. Select the parameter for which you want to create properties and OracleParameter Collection. (You can select all parameters by clicking Toggle All link.)
  4. Click on Make Entity and you will get your complete Entity layer class. In the same way, you will get your DAL also, you can store it as .cs file.
  5. You can set Default Namespaces and class name from Setting Menu.

Points of Interest

Get happiness out of your work or you may never know what happiness is.

- Hubbard Elbert

History

  • 5th November, 2007: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Govind Bhanushali

Software Developer (Senior)
Trigyn Technologies Ltd.
India India

Member

Govind Bhanushali
Analyst Programmer
 
Make a difference today. Smile | :)

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 Pinmemberazeez91212:37 2 Feb '10  
QuestionCan it do packages? Pinmemberdatavalue22:06 1 Jul '08  
QuestionCan give sql connection string to Your application? Pinmemberdo ly viet hung13:54 6 Nov '07  
AnswerRe: Can give sql connection string to Your application? PinmemberGovind Bhanushali20:28 6 Nov '07  
GeneralDon't use bold text PinmvpColin Angus Mackay22:51 5 Nov '07  
GeneralCrap again Pinmembernorm .net21:48 5 Nov '07  
GeneralRe: Crap again PinmemberSudhir Mangla22:08 5 Nov '07  
GeneralRe: Crap again Pinmembernorm .net22:15 5 Nov '07  
GeneralRe: Crap again PinmemberGovind Bhanushali3:05 6 Nov '07  
GeneralRe: Crap again Pinmembernorm .net3:12 6 Nov '07  
GeneralRe: Crap again PinmemberSudhir Mangla5:06 6 Nov '07  
GeneralRe: Crap again Pinmembernorm .net20:44 6 Nov '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 6 Nov 2007
Article Copyright 2007 by Govind Bhanushali
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid