Tuesday, June 30, 2009

CodeSmith templates for Xaf

Yes I know that is not the best practice. When using Xaf or Xpo you should first design your objects and let the framework create the database schema based on objects metadata (attributes). But there are many cases that the database is already design and you can not change it.

What about those projects?

Are you going to say to your customer that you do not want that project?

Are you going to sit down and write all classes by hand?

The best solution on this is to use some Template engine like Codesmith to create the initial implementation for you and then you can change them to meet your needs. You can also find a freeware version of Codesmith here

Devexpress also has a persistent class generation Util which ca be invoked from the add new item form
 

image image

 

but has limited functionality doesn’t create associations, tables with more than one primary keys, knows nothing on xaf and is not at all flexible .

Aristeidis the guy with the beers that day share also his codesmith xaf templates with me you can download them . These templates are not perfect we just share them with you and if you implement more features would could also share back with us.

I will try to apply those templates to Northwind sample database. Northwind has 3 intermediate tables which are CustomerCustomerDemo,Order Details and EmployeeTerritories and I am very interested to know how its going to behave for those. Aris told me that hides the itermediate table from xaf by creating custom collections lets see and usig the ManyToManyAlias attribute.

Download templates and see Video here

thnk you Aristeidis

ps: you can find some old xpo temlates here by Wolfgang Hauer

Subscribe to XAF feed
Subscribe to community feed

DiggIt!

3 comments:

  1. Hi Apostolis,

    I tried to get it to run with the freeware version, but without success. However, it worked with the trial version of CodeSmith Standard.

    It was a real great help. Thanks for your efforts. I tried it on a project with approximately 300 classes. The template had some problems with heavily inter-related classes. Nevertheless it saved me a lot of time.

    Once more, Thanks.

    ReplyDelete
  2. I would happy to update that work with any updates improvments

    ReplyDelete