Archive

Posts Tagged ‘codesmith’

C#.net Daab

October 26th, 2009 Comments off

.net and code generation

I am looking for a simple example of working with C# and CodeSmith (code generation demo available) using DAAB – generated off Northwind.
https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=northwind

There is a product called MyGeneration (free and does doodads and/or DAAB) and a product called LLBLGen that does its own thing too, which are possibilities but the trial version of codesmith is good too.

i.e. Codesmith has many building avenues and features and one is using Microsoft DAAB. It will generate tiered classes and get all stored procedures and their parameter automatically all tiered up.
But it simple creates the project stub with exposure to the Class Factory.
You then need to start coding the stub project and reference the code generated data factory classes.

I would like someone to go the next step and define some ADO.net calls.
i.e. show me an example of using the factory. e.g. use the stored procedures call to fill in a grid, save and update.

Also show me some on the fly embedded SQL at the top layer. ie. on the fly definition of a query cmd = “select * from Contacts” using data adapters not readers.

The aim is to get the development into code.
I have developed before but dragging tables and creating queries on datasets was too disjointed.
i.e. you need to switch to the dataset , find the table, open the query, change it, close it go back test it. forget the field that you were looking at, go back etc. etc.

I am looking for the easiest way to quickly code with .net.
So that I am coding like I do with MSAccess. Which was a dream. You right click get to the code , define DAO and or ADO and get recordsets and if statements and loops and bind and your done in record time.

So what I need is for you to supply a small app based on Northwind using the DAAB via Codesmith or MyGeneration.
And allow me time to review it and ask questions.

Yes I know if you create more code as a stored procedure and re-generate again in Codesmith – the classes update and all is available.
But I have heard that in a large project that the rebuild can take sometime. So breaking the app up into smaller projects seems sensible to avoid that rebuild time wait.
So cinfiguring this way in the demo makes sense too.
And also being able to write SQL on the top layer should help when prototyping ideas and then can move over to stored procedures later.

So this is .net 3.5 yes, but is not doing LINQ and is not doing new ADO.Net Entity Framework stuff.
It is simple ado.net 2.0 equivalent and standard SQL.
I read that Entity Framework can have issues when working in a team environment.
At the moment I know datasets and XML and am comfotable with it if I have to use it – so now looking to get the development process to be quicker by using more code and less dataset objects, if that makes sense. Beside I do not want to use LINQ – I prefer standard SQL.

So once getting me something I need to discuss if this is the fastest way to develop.

This is a very simple and very small application and should take no time at all.
It is demonstrating 2-3 (insert update delete)queries and binding to grids and fields and using Codesmith and DAAB to do code generation.

I mentioned LLBLGen as it is a code generator too.
Hopefully you have used code generators before and have a full proof method of removing time delay that can be experienced in .NET development.
i.e. I am looking for more than someone that has used a code generation tool. I want the best way, fast and easy and editable.

This is not a big job.

Categories: .NET Tags: , , , , , ,
Bear