Awesome Code generation !!!!

Have a look at MyGeneration. ( Click the link !!!!!!!!!!!, don't miss out..... )

This is a freeware code generation tool that really works.....Normally I use the NorthWind database to test code generation and I test it in VB.Net and C#. Usually I have to modify stuff on some points to get the stuff working.

And now I came across this beauty !!!!.

Really try it...... !!! ..............There are several supported architectures but the best (until now) is the dOOdad architecure... (Yes click the link to see what it is...........)

I think it is really awesome..... I just pointed it to the NortWind Database and it worked at once.....
If you are interested in productivity tools have a look at it.

Oh yes and the beauty of it all.... It is all NATIVE .Net.... Not an ugly unknown DLL somewhere NO... everything is compiled. You only have to add a referrence to the dOOdad project.

Ok..... so far I told you to go and visit the website ....Here are some reasons why........

Very easy dynamic queries.........

Dim emps As New Employees
' LastNames that have "A" anywhere in them
emps.Where.LastName.Value = "%A%"
emps.Where.LastName.Operator = WhereParameter.Operand.Like_
emps.Query.Load()

or

Dim emps As New Employees
' LastNames that have "A" anywher in them
emps.Where.LastName.Value = "%A%"
emps.Where.LastName.Operator = WhereParameter.Operand.Like_
' Only return the EmployeeID and LastName
emps.Query.AddResultColumn(Employees.ColumnNames.EmployeeID)
emps.Query.AddResultColumn(Employees.ColumnNames.LastName)
' Order by LastName
' (you can add as many order by columns as you like by repeatedly calling this)
emps.Query.AddOrderBy(Employees.ColumnNames.LastName, WhereParameter.Dir.ASC)
' Bring back only distinct rows
emps.Query.Distinct = True
' Bring back the top 10 rows
emps.Query.Top = 10
emps.Query.Load()

Easy Iteration

Dim emps As New Employees
If emps.LoadAll() Then
   Dim lastName As String
'  Iteration walks the DataTable.DefaultView, see the FilterAndSort
' sample for further clarification.
   Do
      lastName = emps.LastName
   Loop Until Not emps.MoveNext
emps.Rewind()
   Do
      lastName = emps.LastName
   Loop Until Not emps.MoveNext
End If

Easy Bulk Update

Dim emps As New Employees
If emps.LoadAll() Then
' Modify the LastName column in every row
Do
emps.LastName = emps.LastName + "W"
Loop Until Not emps.MoveNext
' Rewind and mark the first row as Deleted
'emps.Rewind()
'emps.MarkAsDeleted()
' Add a new row and fill it in
emps.AddNew()
emps.FirstName = "Jimmy"
emps.LastName = "Lunch Box"
' Save all modifications, deletes, and new rows
emps.Save()
End If

And there are many many more templates based on the dOOdad architecture... Even screens are generated automatically !!!!!

 

Published Mon, Mar 14 2005 11:20 AM by Patrick Wellink
Filed under: ,

Comments

# re: Awesome Code generation !!!!

Monday, March 14, 2005 11:30 AM by Patrick Wellink
First and foremost!

DON'T SHOUT SO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

HAVE YOU EVER LOOKED AT YOUR POSTS ON THE FRONT PAGE?

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH!

And second, what's the differnce between an ugly .dll and a compiled library that you can set a refence to in your project?

# re: Awesome Code generation !!!!

Monday, March 14, 2005 12:53 PM by Patrick Wellink
Read this article (http://www.codeproject.com/dotnet/GriffinMyGen.asp) about MyGeneration on CodeProject.
At the bottom there are some discussion threads and "Business Objects shouldn’t be developed one for one per table" is especially interesting...

"I have successfully shipped many projects like this, big .NET apps, and can even out bid Indian based companies doing outsourcing for a dime on the dollar. Give me a SQL database and in a day or so I'll give you a complete, functional object model that can read and write, supports transactions (seemless via TSL) and more. This is the just the beginning.
"

Even with the disscussion about architecture and business objects still going on, it's quite promissing...: "a functional object model in a day" Cool!

# re: Awesome Code generation !!!!

Monday, March 14, 2005 12:57 PM by Patrick Wellink
However, I'm still looking into the possibilities of db4Objects (http://www.db4o.com/), which Robert Jan pointed out at http://bloggingabout.net/rj/archive/2005/03/01/2318.aspx.

If both O/RM and OODB work well, I prefer the latter for obvious reasons.

# re: Awesome Code generation !!!!

Monday, March 14, 2005 1:09 PM by Patrick Wellink
First of all Dennis you should know i ALWAYS shout if there's something exiting.....

I also wanted to shout cause i think every body should read this article...... even if they don't want to !!!!!

And to Ernst i can only Say.....

Ernst... It really works ..... !!!!!!


# re: Awesome Code generation !!!!

Monday, March 14, 2005 1:21 PM by Patrick Wellink
Oh and I forgot to mention in the article ....

I test with large datasets as well... my Northwind Customer database has over 100.000 records in it.....

You will see some nice surprises when you start using stuff like LLBLGEN and there are lotsa records......

dOOdad ouperforms LLBLGEN by a factor 8.....

so 1 second for dOOdad and 8 seconds in LLBLGEN !!!! I know the principles behind the tool are COMPLETELY different... but all the nice stuff of LLBLGEN comes at a big (performance) price......


# re: Awesome Code generation !!!!

Monday, March 14, 2005 2:00 PM by Patrick Wellink
"You will see some nice surprises when you start using stuff like LLBLGEN and there are lotsa records......

dOOdad ouperforms LLBLGEN by a factor 8..... "
I doubt it. For example, you can finetune your query by switching from joins to subqueries, which can gain you a lot in multi-table filters with lots of records.

There is no sql doodads can generate that LLBLGen Pro can't.

So, what's the code you ran?

# re: Awesome Code generation !!!!

Monday, March 14, 2005 2:06 PM by Patrick Wellink
Frans....

Sorry....

This was just a Query on a simple Postcode table with 300.000 records....

We simply wanted them all... No joins and only 4 fields in the table.......So there's nothing to optimize !!



So as easy/Simple !!!!!


# re: Awesome Code generation !!!!

Monday, March 14, 2005 2:53 PM by Patrick Wellink
Patrick, thanx for the compliment. You are correct in that dOOdads is extremly lightweight and has almost no overhead over and above ADO.NET. Our dOOdads architecture focuses on serving up your data with an elegant API. We're glad you like it.

- Mike Griffin

# There is no sql doodads can generate that LLBLGen Pro can't.

Monday, March 14, 2005 4:59 PM by Patrick Wellink
Frans Bouma
"There is no sql doodads can generate that LLBLGen Pro can't."

Frans, the SQL is not the issue, it's the underlying archtecture. The two greatest myths I hear all of the time are:

1) Never make business entities map directly to a table (I do it all the time and so do tons of our customers). Of course we can generate them for views too.

2) Never use a DataTable, they're too slow. Nonsense, DataReaders are faster sure, if you never plan to actually use the data you fetch. However when you go to copy the data out of the reader to populate your entities you waste a ton of time a memory and time, and you're garbage collection issues go up significantly on high end web sites. The dOOdads architecture literally never moves the data, it resides in the DataTable. So loading a dOOdad is no more than loading a DataTable, the elegant API is literally "laid over" the DataTable. The dOOdads technique (and our new EntitySpaces due out with 2.0) will really come into play with the terrific advances coming in .NET 2.0 concerning DataTables.

# re: Awesome Code generation !!!!

Monday, March 14, 2005 5:45 PM by Patrick Wellink
Yes, llblgen pro is a bit slower in entity collection fetches than normal datatable fetches. This is because for each row, an object has to be created, filled, added to the collection etc. which is a little more overhead than a new datarow added to a datatable.

Though, with a datatable based architecture you can't use the individual objects without having the datatable around, as the datarow doesn't have a public constructor. So 1 customer always creates one datatable.

In llblgen pro, if you want everything in a datatable, you can of course do that, or in a typed datatable, you can do that too. You can even define the list in code if you want.

As datatables use an arraylist to store the datarows, adding one has a performance hit in the long run, i.e. when there are a lot of rows in the datatable. MS doesn't recommend to fetch more than 57000 rows in a datatable, which is a lot also.

# re: Awesome Code generation !!!!

Monday, March 14, 2005 5:47 PM by Patrick Wellink
btw, I doubt you can fetch 300,000 rows in a datatable in 1 second, or the rows are very very small, but even then.

# re: Awesome Code generation !!!!

Monday, March 14, 2005 5:54 PM by Patrick Wellink
" However when you go to copy the data out of the reader to populate your entities you waste a ton of time a memory and time, and you're garbage collection issues go up significantly on high end web sites."
haha, and how are you filling your datatables, Mike... using Fill()? or copying the data yourself? Either way, it doesn't matter, you're copying data.

I also don't see the garbage collection issues, as you can't re-use the resultset produced by a datareader without copying it to some container (be it a datatable, custom object...).

The overhead you miss is that you don't have to setup fields with every object, just once with the datacolumns. So a datareader fill is then nothing more than creating a datarow and moving over the cells per value. It's a bit faster, but for a price.

# re: Awesome Code generation !!!!

Monday, March 14, 2005 10:53 PM by Patrick Wellink
Dennis: This post is classical Patrick; no filter between thought and post.

Patrick: As brilliant you are, I still think you haven’t given both products much time to evaluate. As such, you address only the out-of-box experience. Important as this property is for end user products, a software development tool is a different beast. Don’t make too hasty a conclusion. Do stay tuned though, and watch me do the same.

Frans: I haven’t given LLBLGen Pro the time it deserves to fully appreciate its potential power. In fact, I stopped evaluating LLBLGen Pro just one hour after downloading and installing it. The reason was that there does not seem to be a database-diagram kind of view of the database. At least, I couldn’t find it. So I stopped. Sorry.

In Visual Studio .NET 2003, you create a database diagram simply by adding all tables to a newly created empty diagram. The resulting diagram nicely shows the relations. To get a typed dataset, you can drag tables to a XML Schema. The code VS2003 generates may be horrible, I don’t really know. The point I’m trying to make is that I like interacting with a database in a graphical manner.

The Project Explorer in LLBLGen Pro has all the information necessary to build an UML view of the relations between tables (entities). But I still need to make a mental picture of the complete database. That doesn’t make sense to me.

# Patrick, thanx for the kind words

Tuesday, March 15, 2005 1:29 AM by Patrick Wellink
Patrick, I'm going to depart this thread, you've stirred quite a hornets nest you know. Talking kindly about a free product written by a couple of no-names without any Microsoft certifications is very dangerous <wink> and the long knives are going to come out soon.

Anyway, MyGeneration is my (our) side project and not my full time job so my weekend and evening time needs to be poured in MyGeneration 2.0 and our new architecture EntitySpaces ... Best of luck to you.

Mike Griffin
MyGeneration Software

# re: Awesome Code generation !!!!

Tuesday, March 15, 2005 8:19 AM by Patrick Wellink
Well Thanks mike...

And all the explanation of frans bouma.... I already knew why llblgen was slower..

"I know the principles behind the tool are COMPLETELY different... but all the nice stuff of LLBLGEN comes at a big (performance) price......"

I just wanted to point that out.... I am using dOOdad in a private project now and it really works great.

I bet those guys never even downloaded MyGen and never even looked at the dOOdad architecture.

And I dont want to mention LLBLGEN anymore..... cause this is about MyGeneration !

Mike Keep up the Good work.
( i am busy with the DAAB architecture as well..)

# re: Awesome Code generation !!!!

Tuesday, March 15, 2005 8:23 AM by Patrick Wellink
Oh yes and to frans......

"btw, I doubt you can fetch 300,000 rows in a datatable in 1 second, or the rows are very very small, but even then. "

We simply wanted them all... No joins and only 4 fields in the table.......So there's nothing to optimize !!

4 fields only, 3 of them are int, it's a 4 processor server with 4 GB of memory.... and hey if we would count HT as well there would be 8 processors.....

so this was a pretty powerfull server.....

# re: Awesome Code generation !!!!

Tuesday, March 15, 2005 8:40 AM by Patrick Wellink
oh yes and we have GB lan.....

# re: Awesome Code generation !!!!

Thursday, March 17, 2005 3:56 PM by Patrick Wellink
Good to see you joining the mygeneration bandwagon :)

Been using the product for a while and enjoying it's simplicity.

# re: Awesome Code generation !!!!

Monday, April 11, 2005 11:14 AM by Patrick Wellink
I just started to use MyGeneration, it works well. but can one show me how to build the query that has "OR". All parameters should be compared against one column in my table.

eg.

emp.Where.Name.Value = "X%"
emp.Where.Name.Conjuction = WhereParameter.Conj.Or;

emp.Where.Name.Value = "E%"
emp.Where.Name.Conjuction = WhereParameter.Conj.Or;

# re: Awesome Code generation !!!!

Monday, April 11, 2005 2:36 PM by Patrick Wellink
I believe you should use the cutoff

# re: Awesome Code generation !!!!

Tuesday, April 12, 2005 3:32 PM by Patrick Wellink
Or use the Raw query method... i don;t know it''s name but you can execute raw SQL statements.......

# re: Awesome Code generation !!!!

Wednesday, January 31, 2007 1:56 AM by Neil

Useful blog info except:

- all people commenting listed names as Patrick Wellink

- there is no wrap on the comments, i'm having to view source to read them

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Please add 1 and 8 and type the answer here: