views:

115

answers:

2

I recently ran across this open-source project: http://www.codeplex.com/Sculpture

Sculpture is a code-generator which allows you to design your domain model and then use persistence 'molds' such as NHibernate/EF and probably more to generate repositories. It takes care of all the mapping and Data access generation. It looks like it does a heck of a lot more, but i'm pretty much sold at this point. However, i would like to know if anyone here used this for real-world solutions. If so, how well does it scale? How did the generated DAL work for you?

A: 

I would say that most ORMs are generated in some way at this point. I'm using Linq-to-SQL for a current project, you setup your model and generate code (with attributes from the model).

In short, it's nothing new and there's no reason to rebuff it just because it's generated.
Most ORMs can or do work this way, and they do so well.

Nick Craver
I don't know if i would agree with that. I haven't done much with L2S, but as far as i remember it isn't POCO friendly. I mean, you can map L2S generated entities to your model, but that's not what i'm looking to do. As far as i can tell, Sculpture generates a pluggable domain that can work with EF and Nhibernate for data access. This is pretty huge for me, but i haven't found out much on how well it does this. It also allows for model-first design, which is, as far as i remember, the opposite of L2S.
Sergey
@user68137 We actually use a variant that's Linq-to-Oracle, but you can do all those things with the generation, just against a specific provider (e.g. I can model it all, hit create database). They might have a ton of crap that happens to slow down the data access...it's entirely possible. My point was just don't think something's inefficient **just** because it's generated, there's plenty of counter-examples to this. Efficiency also depends on *how you use it*, common example: querying tables when you don't need to will slow you down and you can do that it in every provider out there.
Nick Craver
+1  A: 

We have taken this out for a spin on a new project we had. Always wanted to try out nHibernate but the XML hell of the config files always put me off. Tried a number of these type "helpers" this is the easiest to use so we decided to use it.

I like the facts that you can just point at databse and it will create object based on what it sees and will resync on demand. It was also good that you could add custom methods to these objects and has a very well written syntax for the generated code all using LINQ-To-NHibernate.

It also generated a respository project over the top to allow you to use this design pattern which we did (again another personal goal).

It all worked out very well, created a social (facebook like) site for people with a medical condition, got everything fully working in 3 weeks with onlt 3 people.

On the whole very happy with this - in fact bought a licence for Sculpture 2.1 Nhibernate mold. (note open source but not for nhibernate mold :-) )

There is room for improvement Windows 7 64 bit had to run visual studio in admin mode (my pc only) - not sure why TeamCity continuous integration had some issues with paths to dll files - the two generated project (ORm and Repository) use different paths to base dll's - so needed to work out position of source in filestore to automate the build but worked fine.

Would like to heard any views on this or other product which people think are better ..

Looking to do a project where we will create all the objects in sculture and get it to produce/update the database for us - will be odd as we are db type developers but will be good to see how this works..

Thanks Simon

Simon Thompson
Well, i haven't actually tried it on a project, but i have generated a few molds just to see what it's spitting out. While i do like the architectural separation and the patterns used, i think NHibernate mold leaves a lot to be desired. It seemed that the repository left out all of the session management stuff. Moreover, instead of creating a new session, it was recreating the session factory in each repo constructor, which is very inefficient especially on larger projects with a larger model. Still, this is by far the most helpful code-generated i've seen. I'm sure improvements are coming.
Sergey
Thanks for the observations very helpful, I will repost this to the vender forums to get these issues ont he radar. If you come accross a better product would like to hear about it/them.Many thanksSimon
Simon Thompson