CodeSmith 3.6.x Template Suggestions

CodeSmith 3.6.x Template Suggestions

Old forum URL: forums.lhotka.net/forums/t/6232.aspx


bniemyjski posted on Wednesday, January 21, 2009

Hello,

I'm a developer over at CodeSmith Tools and we are currently implementing new CSLA 3.6.x templates. If any of you have any template suggestions or improvements that you would like to see please let me know.

Thanks
-Blake Niemyjski

richardb replied on Thursday, January 22, 2009

No suggestions from me but great news if these are coming soon - I know quite a few people want to use these.

Thanks.

lukky replied on Thursday, January 22, 2009

Blake,

As we have discussed a bit on the CodeSmith forum, I'll simply post here too so that maybe other CSLA users will have ideas from my observations.

One of the first thing I'd like to see is the use of Sub templates instead of include files. This will allow syntax highlighting in CodeSmith Studio.

Also, we need to provide a lot of hooks in the form of partial methods to allow customizing the behavior without having your changes overwritten. There's already some, but the more the better. If you don't use them, they don't produce any code anyway.

Next, and I'm currently working on this so if you want I can help, would be the possibility to create the Business Objects from a Linq to SQL DBML file. Right now the templates that Ricky Supit has written offer the possibility to load from either Table, Command, View or even XML file. Having the option to pull the metadata from the DBML file would pave the way for when we have better understanding of Entity Framework. It will then be "easy" to add this new schema provider.

Those are a few observations. Maybe more ideas will come over time.

Regards.

bniemyjski replied on Thursday, February 05, 2009

Hello,

"One of the first thing I'd like to see is the use of Sub templates instead of include files. This will allow syntax highlighting in CodeSmith Studio."

We started writing these templates from scratch and this was the first thing to happen. There will be no include files.

"Also, we need to provide a lot of hooks in the form of partial methods to allow customizing the behavior without having your changes overwritten. There's already some, but the more the better. If you don't use them, they don't produce any code anyway."

I have split up each template into two files. one being the generated partial class with the data access, factory methods,  business methods. I've also included the Validation rules and authorization rules in this partial class and made it them partial. Then we have the non generated partial class which consists of the partial rules methods.

"Next, and I'm currently working on this so if you want I can help, would be the possibility to create the Business Objects from a Linq to SQL DBML file. Right now the templates that Ricky Supit has written offer the possibility to load from either Table, Command, View or even XML file. Having the option to pull the metadata from the DBML file would pave the way for when we have better understanding of Entity Framework. It will then be "easy" to add this new schema provider."

We are currently talking about this, eventually by version one or two, we want to be able to generate off of a edmx, or dbml :). Down the road when we get to beta / release mode if you would like to review these templates and give us your feedback that would be awesome :).

Thanks
-Blake Niemyjski

mamboer replied on Thursday, February 05, 2009

Hi,
I'm concerned on the DA tech u choose.
LinqToSql,or EF?

mamboer replied on Thursday, February 05, 2009

Have u throught about the affections on code gen when we use Repository pattern in DataAccess layer?

bniemyjski replied on Tuesday, February 17, 2009

Hello,

Sorry about taking a bit to get back to you, I haven't been getting the emails when ever someone responds to my posts.

"I'm concerned on the DA tech u choose. LinqToSql,or EF? "
Right now we are using Parametrized SQL, but have made it generic so you could potentially use anything like EF or L2S.

"Have u throught about the affections on code gen when we use Repository pattern in DataAccess layer?"
Could you please expand on this a bit. Do you have any documentation on using the Repository pattern with CSLA?

Thank you,
Blake Niemyjski

PaulNakata replied on Wednesday, February 18, 2009

I'm very excited for you guys to release your templates - We've got an old CSLA project that was originally generated using the CodeSmith 1.1 templates and we're getting ready to regenerate our base classes for use with 3.6.. We use parameterized SQL already, so it'll be a nice fit!

Any word on how close you are to release?

bniemyjski replied on Wednesday, February 18, 2009

Hello,

"Any word on how close you are to release?"

It's hard to tell, there is still a bunch of work that needs to be done, we should have a beta out within the next month or so.

Thank you,
Blake Niemyjski

bniemyjski replied on Wednesday, March 18, 2009

Hello,

Please view this post for a sample project.

Thanks
-Blake Niemyjski

Copyright (c) Marimer LLC