Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
CodeSmith offers this availability with various
template frameworks (Linq-To-SQL (PLINQO), NHibernate, CSLA, .netTiers) as well as custom templates like stored procedure generation and stored procedure wrappers. Let me know what your requirements
are and I'll put you down the right path. Also here is a
video tutorial on VS2008 integration.
I am trying to generate data Access Layer(DAL) and Business Logic Layer (BLL) code.
For example I want to CRUD operations as well as Select on various tables in postgres,SQL Server and Oracle.How can I be able to generate the code automatically?
Can I do UI validation code generation using such tools?
For example I want to CRUD operations as well as Select on various tables in postgres,SQL Server and Oracle.How can I be able to generate the code automatically?
Something like NHibernate will give you CRUD as while as a dynamic querying api against all those databases in 200 lines of code or less. There are several good validation frameworks out there which will allow you to declare and check simple rules with
a minimum of code.
If the answer I provided is useful or informative please check the "answer" button.
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.
I work for CodeSmith so I don't want to give you any biases... what were you thinking about when it comes to Infragistics? You would need to evaluate both products to figure out which one works better for you. I can tell you that CodeSmith has way more flexibility
when it comes to templates that support different frameworks (Like NHibernate). IronSpeed is targeted towards generating pre designed user interfaces. Microsoft just came out with LightSpeed which I think is cutting into IronSpeed's market share.
Code generation is NOT a bad idea. Most of us get paid to automate business processes and if we can use T4 templates to generate the skeleton of our project or combine it with DSL's and Guidance Packages so that we as developer no longer have to care about
the plumbing and instead can focus on what the application really is about. There is nothing wrong with that, developers should even use it more instead of wasting time implementing their own version of a lightweight IoC every new project they start as a matter
of speech.
Give a man a fish and you will feed him for a day. Teach a man to fish and you will feed him for a lifetime.
Marked as answer by sunny74 on Oct 06, 2010 08:31 PM
sunny74
Participant
1494 Points
782 Posts
auto code generation
Sep 02, 2010 05:57 PM|LINK
Dear All,
What are possibilities of automatic code generation using C# and Visual studio 2008?
All I know is that there are 3rd party tools like Infragistics and IronSpeed that do this kind of stuff.
I don't know if there are any means by which we can do the same i.e generate classes, methods without having to write the code in VS.
Has anybody done something like this?
If so pls let me know what and how?
Thanks.
PLS MARK MY REPLY "AS ANSWER" IF IT HELPED YOU.
robert.weste...
Contributor
2352 Points
399 Posts
Re: auto code generation
Sep 02, 2010 06:49 PM|LINK
Hi,
A very nice way to do code generation in Visual Studio is to use T4. Scott Hanselman wrote a blog post regarding this in 2008. http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx The blog post in itself isn't very much helpful in learning, but the links he provides are.
Hope it helps!
/Robert
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
JeffreyABeck...
All-Star
16423 Points
3329 Posts
Re: auto code generation
Sep 02, 2010 08:40 PM|LINK
Generally code generation is a large neon sign pointing to a mis-implemented cross-cutting concern. What type of code are you trying to generate?
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.
Blake05
Contributor
2561 Points
511 Posts
Re: auto code generation
Sep 03, 2010 10:59 AM|LINK
Hello,
CodeSmith offers this availability with various template frameworks (Linq-To-SQL (PLINQO), NHibernate, CSLA, .netTiers) as well as custom templates like stored procedure generation and stored procedure wrappers. Let me know what your requirements are and I'll put you down the right path. Also here is a video tutorial on VS2008 integration.
Thanks
-Blake Niemyjski
Blog - Website: windowscoding.com
sunny74
Participant
1494 Points
782 Posts
Re: auto code generation
Sep 10, 2010 08:05 PM|LINK
Hi Jeffrey,
Thanks for your reply.
I am trying to generate data Access Layer(DAL) and Business Logic Layer (BLL) code.
For example I want to CRUD operations as well as Select on various tables in postgres,SQL Server and Oracle.How can I be able to generate the code automatically?
Can I do UI validation code generation using such tools?
PLS MARK MY REPLY "AS ANSWER" IF IT HELPED YOU.
JeffreyABeck...
All-Star
16423 Points
3329 Posts
Re: auto code generation
Sep 10, 2010 08:45 PM|LINK
Something like NHibernate will give you CRUD as while as a dynamic querying api against all those databases in 200 lines of code or less. There are several good validation frameworks out there which will allow you to declare and check simple rules with a minimum of code.
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.
sunny74
Participant
1494 Points
782 Posts
Re: auto code generation
Sep 11, 2010 12:05 PM|LINK
Hi Blake,
Thanks for your reply.
What about Infragistics and IronSpeed?
I believe they r also doing template based code generation.
Which is the best among these?
IronSpeed has a free version while the others doesn't have one.
PLS MARK MY REPLY "AS ANSWER" IF IT HELPED YOU.
Blake05
Contributor
2561 Points
511 Posts
Re: auto code generation
Sep 13, 2010 09:29 PM|LINK
Hello,
I work for CodeSmith so I don't want to give you any biases... what were you thinking about when it comes to Infragistics? You would need to evaluate both products to figure out which one works better for you. I can tell you that CodeSmith has way more flexibility when it comes to templates that support different frameworks (Like NHibernate). IronSpeed is targeted towards generating pre designed user interfaces. Microsoft just came out with LightSpeed which I think is cutting into IronSpeed's market share.
Thanks
-Blake Niemyjski
Blog - Website: windowscoding.com
JeffreyABeck...
All-Star
16423 Points
3329 Posts
Re: auto code generation
Sep 13, 2010 09:33 PM|LINK
I will of course reiterate my opinion that code generation is just a bad idea.
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.
gabriel.loza...
Contributor
3583 Points
800 Posts
Re: auto code generation
Sep 13, 2010 09:46 PM|LINK
Code generation is NOT a bad idea. Most of us get paid to automate business processes and if we can use T4 templates to generate the skeleton of our project or combine it with DSL's and Guidance Packages so that we as developer no longer have to care about the plumbing and instead can focus on what the application really is about. There is nothing wrong with that, developers should even use it more instead of wasting time implementing their own version of a lightweight IoC every new project they start as a matter of speech.