Modifying Data Access Guidance

Topics: General Discussion Forum
Feb 23, 2007 at 4:37 PM
I have been using the Service Factory for some time now and finally feel comfortable enough to attempt to make some changes to the guidance automation packages. I have installed all of the necessary software, have successfully built the Data Access Guidance package and made some changes. I now want to test and deploy those changes. I know there must be information somewhere that will guide me through the process of replacing the existing Data Access guidance with my modified version, but I haven't been able to find it. Can someone point me in the right direction? Thanks
Feb 23, 2007 at 5:11 PM
You can simply register the package right clicking the package project (Check that you have enabled the "Guidance Package Development" package that comes with GAT). After that you can test you changes (Debugging Guidance Packages) and after building the included Setup project, you will get an msi to deploy the package.

Charly
Feb 24, 2007 at 6:24 PM
Thanks, I had not enabled the Guidance Package Development (duh). Everything works fine now. BTW (although I suspect that others have already some or all of these things), I have made changes to the Data Access Guidance Package that have been very useful to me. If anyone is interested, I'll be glad to post the actual changes. It was quite straightforward, which speaks well of the GAT even at this early stage.

I work in an Agile development environment, and wished for better support for small, incremental changes in the DAL. One of the things I find is that I am continually adding stored procedures as I increase the functionality of my site. However, when you have to add a new stored procedure in the 'Create data repository classes from business entities' recipe, there are several short-comings:

1) You have to re-specify all SPs, even ones you have already been using. This is because the repository class is re-generated with only operations for the current SPs you are adding. I have modified the 'EntityRepository.t4' template to create the base repository as a partial class and create additional partial classes with the operations to invoke the SPs. When you add a new procedure, you still re-generate the common repository file, but since it only contains common stuff, it will be unchanged. I then add a new partial class that contains a single operation. One is created for each SP you are adding. Previously generated operations are unaffected, so you now only need to specify the SPs you are adding.

2) I use the same names for my table attributes, SP parameters, and business entities. Even so, when you add a new SP to generate a new operation, you must manually add the mappings. I have added a checkbox to 'AutoMap'. When checked, the mapping for columns and properties that have the same name is done automatically. Unchecking it removes all of the mappings. With some of the larger tables this is a huge cramp-saver.

3) As the list of SPs gets large, it becomes increasingly annoying when scrolling down the list to the desired SP. I have added a checkbox to 'Filter by Entity Name' which will subset the displayed list by only showing SPs with the selected entity name in them. This is not a completely generalized feature because I create the plural by adding an 's' or by deleting the 'y' and adding 'ies', but it is really useful for what I do as it reduces a list from a hundred or more to a dozen or so.

Thanks again for your quick and useful response.
John
Feb 26, 2007 at 2:15 PM
John,

Thanks for the great feedback and all your comments on usability and suggestions. I think that other users may find these changes useful so feel free if you wish to share your changes with the community, by opening a new discussion thread here with some links to your updates or post an entry on the Issue Tracker area to suggest these changes for next release.

Charly