Wednesday, May 23, 2007
Improvements to the Business Object / Entity generator
One of our main tools in Milos has always been our Business Object / Entity generator, that's available within the EPS Developer Services tool. That feature had some crucial limitations, though, so we've revamped it, including a number of fixes and improvements that we are sure a lot of users are going to appreciate. I'll list some of them here:
- Integration with Visual Studio.
Generation of more than one collection at a time.
- Previously, the tool worked stand-alone, and the files generated had to be manually included in the project in VS. The current version works as a plugin, running within VS, and that way the files generated get immediately added to the project.
Creation of entities that aren't modeled from a SQL Server database.
- Previoulsy, one could only create one child collection and one xlink collection at a time. Now any number of collections can be added at a single pass.
Classes can be regenerated.
- Previously, one could only generate entities based on a table/view in SQL Server. Now we support the creation of an entity from scratch, and underlying data for this entity is stored in XML files. This works great for prototyping modules and creating unit tests without having a need to create tables on the database, which means the developer can concentrate first on the classes to create, and only worry about how to persist that on the backend later. We'll have another post dedicated to this subject soon. It's also worth pointing out that the underlying engine on the generator has gone through a big refactoring to decouple it from SQL Server so to support the entities based on XML data sources. This means that now we can more easily work on adding support to create entities based on other backends such as Oracle, MySql, etc.
Separation of class in individual files and partial classes.
- Previously, if the developer needed to add things to a class (say, more properties to a business entity), she'd need to run the tool again, creating the entity as if it were the first time, and then manually move pieces of code from the newly generated files into the existing ones. Yup, painful. The new tool saves the definitions of the objects created, which allows for the tool to recreate the entities without forcing the developer to remember to recreate it as it was done before.
- Previously the tool created one file for the business object class, and one file for the business entity class along with its collection and business item classes (collection items). The new tool creates a subfolder in the project, named after the business object (such as CustomerBusinessObject), and put the new files in that folder. Every class goes into its own separate file, and every class is also separated in two files (as a partial class): one for the code-generated content, and one for the custom code developers add to it. This means that the developer can regenerate code for business entities and objects without wiping out the custom code. Yeah, it was about time, right? ;)
The main point is: the new generator gives us everything we used to have, plus a LOT more, so this is definitely the way to go moving forward. There is only one thing we don't have on the new tool yet: it doesn't auto-update yet. Since it's a VS plug-in, we couldn't just use ClickOnce out of the box. So, if you're creating and working with business objects and entities, send me an email soliciting a copy of the plug-in, and I'll send it to you (of course, you have to be a Milos user to request it. My email is my first name at eps-software.com). I'll put you on my mailing list to receive updates, until we get the auto-update feature into the plug-in.
Also, the installation and usage of this plug-in has been documented in videos. I'll post a blog entry about this shortly. Make sure to check it out!
Posted @ 1:31 PM by Lassala, Claudio (email@example.com)