New Toy, cont’d.

I managed to grab a brief sale of the Toshiba A205-S6810 on Amazon, for $749, with free shipping within US. It was not as low as the $699 when I first spotted it, but it was still much lower than the $979 regular price. I’m happy I made this purchase. (For those in the Philippines who are interested in getting cheap laptops in the US, go for Amazon and have it delivered through Johnny Air Cargo in New York. I learned about this in a post in Tipid PC. You still get a lower price compared to what’s sold locally, even if you pay for more than $100 of shipping.)

So, with a Vista powered toy in hand, I proceeded to install all the software for my new development machine, starting with the latest from my MSDN subscription, stuff which I held up from installing because they were meant for Vistas, multi-core CPUs, and larger RAM. Stuff such as running server products (Sharepoint Server 2007, Visual Studio Foundation Server 2008, and the like) off Windows Server 2008 through a Virtual PC.

Now, I’m ready to set up for my agile development environment, starting with source control through Subversion. I learned that Subversion interfaces with Apache, but not with IIS. A minor setback, but that’s alright. I also learned that my old version of WAMP won’t run on Vista because of tighter security measures (it is unable to write to the registry or start a service on its own). I then went ahead with downloading the newer WampServer 2 and a Subversion version that runs for Apache 2.2. It will be integrated using instructions from this TrajiklyhHip blog entry.

This will be followed by an installation of TortoiseSVN, the Subversion client for Windows, and integrating it into Visual Studio 2008 with guidance from Garry’s Bit Patterns blog entry.

I will proceed with NAnt, NUnit, CruiseControl and BugTracker.Net when I’m done with source control setup.

New Toy

I can’t wait to get my hands on my new toy. I finally managed to get an order for a Core 2 Duo machine from Amazon and have a friend ship it here.

It isn’t the same spec as I initially wanted. The Toshiba Satellite I was eyeing had a sudden jump in price from the discounted $699 to $899.

So, instead, I went for a Compaq Presario V6000T that was offering for $712. Slightly more expensive than the original Toshiba, and lower specification with 2GB RAM and 160GB HD.

I had to choose between this, a Core 2 Duo machine, and a cheaper Athlon 64×2 Dual Core. I’ve read that the Core 2 Duo is faster with the same MHz rating, has longer battery life, and is less hot, so, despite the slightly higher price and limited upgradability (it is maxxed at 2GB RAM), I went ahead and managed to grab the last one in stock, not wanting to miss another sale opportunity.

CNet gave this model a 7.5 rating for its attractive design, respectable application performance, long battery life and configarability.

NHibernate Mapping Concerns

I encountered two errors in my code related to mapping.

First, there was incompatiblitity between IList (which was how I defined my collection properties in the Resume object, like Education History) and NHibernate’s Set mapping. (It turns out that Set derives from a non-native library called Iesi.Collections. I tried referencing Iesi.Collections in my code but it seems that it couldn’t find it in my NHibernate.dll.) It was resolved by changing the <set> tag in my map to a <bag> tag.

The second was some loading problem when my code tried to call the collection values. I learned that the bi-directional association which I set into my mapping doesn’t work for indexed collections like IList. I then took out the many-to-one tag, and it worked.

With these major mapping issues ironed out, I can now proceed with completing the DAO (data access object) implementation of my resume schema, and then move on to creating the UI forms for them.

The 2008 Learning List

Apart from the certifications I’m targetting for this half of the year, I made myself a list of things that I should learn (and use in my mini-projects) this year (in no particular order):

I’m just waiting to get a new laptop before I can start tinkering with these. I’m not too confident of .Net 3.5’s (particularly WPF) performance on Windows XP, and on my sluggish 4 year old laptop. I should also have at least a Core 2 Duo with 3GB RAM to get Virtual PC running smoothly for server instances for Sharepoint (and play around with Windows Server 2008).

Resume App Progress

I decided to forego the SCSF implementation of the Resume Builder after repeatedly getting assembly errors related to my references to Microsoft.Practices.CompositeUI library.

The advice was to delete the compiled dll files from the Debug / Bin folder. I did this a number of times and still get errors occassionally.

I deemed my SCSF installation unstable and went ahead to doing a plain old Windows form. I am currently in the process of incorporating NHibernate.

Initial challenges to installing NHibernate to my project involved getting errors related to configuration, in particular, Null Reference Exception. NHibernate has its own sequence of looking for the configuration file, and realized that I didn’t have to refer to the default configuration file explicitly. I merely had to ask the configuration object to add my current assembly, via AddAssembly, and moved my configuration settings from an external hibernate.cfg.xml file into app.config*. It worked.

*NHibernate has a number of ways to read configuration. You can set it programmatically by invoking methods directly, but this will reduce the maintainability of your app since you’ll need to recompile everytime settings need to be changed. You can add configuration entries into your app.config or web.config, or you can put the config in an external file, like hibernate.cfg.xml.

Having resolved that, I am now working on the mapping file. I have yet to fully familiarize myself with how it deals with one-to-many relationship collections, and other mapping concerns.

Contract-First Development

Contract-First Development (also known as Design by Contract), is a programming approach that, in the age of web services, starts with the schema used in a data exchange, and design the application from there.

I am currently using the same approach in a new personal project. As mentioned in my previous post, I am working on a prototype for an SCSF application, a Resume Builder application built on top of HR-XML standards.

I downloaded the XSD files and worked on creating the entity classes and database schema out of them. The specifications are long, so instead of doing them by hand, I decided to look for tools. For the entity class generation, I used Microsoft’s XSDObjectGen, a sample code generator for creating serializable classes from XSD schemas. For the DDL generation, I downloaded an evaluation version of the Altova XMLSpy, quite a powerful xml developer tool.

Both did a good job in rendering the XSD schemas. The problem I have, though, is that the schemas are so normalized, to the point that types that should have been, for us humans, simple enough, are rendered as separate classes and tables, like Entity ID or phone numbers. I don’t see the sense of keeping them that way as it will take a lot of connectors, even if I used an ORM like NHibernate, and it will also be slow and inefficient on the database.

I am now faced with the following choices: (1)  Use a much simpler Resume schema like the XML Resume Library at Sourceforge; (2) Stick with the HR-XML schema, but code the entity classes and create the database structure from scratch manually; (3) Derive a simpler schema by taking out the normalized “simple” entities such as IDs and phone numbers and replacing them with strings - not so trivial a task as there are many throughout the entire structure; or (4) Clean up the resulting entity classes and database structure.

I have not yet decided which one to take. I am hesitant to go for Option 1 because HR-XML is an industry standard, and though large job sites like Monster.com don’t use it, there is a growing clamor to get them to adopt it. Besides, the XML Resume Library at Sourceforge has been left unupdated since 2004, probably because of the popularity of HR-XML. Option 2 is simply a lot of work. I am deciding between Option 3 and Option 4, depending on which one will be easier to do. Either one violates the XSD contract and will take some intermediate processing before the serializer can generate XML that’s 100% compatible with the schema.

Oh by the way, with regards to database generation, there’s one more issue with using Altova XMLSpy for this purpose. Because container datatypes contain the datatype itself and not a reference value like a key, the rendered tables will not have foreign keys. The relational feature of AltovaXMLSpy’s database generator will only present you with the types’ simple child types. (I believe there SHOULD be a feature that automatically creates an ID field, or identify one. There should also be intelligence in looking at relationships and deciding whether intermediate tables are necessary - ah wishful thinking.) The workaround here is probably to either violate the schema (again) by replacing the contained child types with IDs or manually add the references after the tables have been generated. I’d probably go with the latter. (Given the normalized nature of the schema, this is probably going to be almost like creating the database structure from scratch.)

Any suggestions for a better approach or a better tool (.Net for entity class generation) will be very much welcomed.

Update 02/24/2008 5:11pm

After looking through the generated .cs file and the database tables, and reading in forums, I have decided to start off with a simple structure that is loosely based on the HR-XML schema and go ahead with the development.

(I gave up when realizing that the class structures and tables are too different from each other for me to try to fix it - Option 4 as mentioned above. The class structures contained too many collection objects and enums, and the latter eliminated key information like relationships. The difficulty with dealing with the generated output also eliminates the use of tools, so modifying the schema and doing Option 3 is out.)

I also discovered that HR-XML is coming out with a more streamlined Resume.xsd version 3.0, taking out all the deprecated content in 2.* versions that have been kept for backward compatibility. They will also de-layer structure to make it XML form-tool friendly.

Check out recent developments:
http://docs.hr-xml.org/resources/HR-XML-Resume_final.pdf
http://docs.hr-xml.org/resources/HR-XML-3-0-webinar.ppt

So, it’s set. I am going to instead have my structure and create a transformation utility that will generate a compliant XML file. It will also allow for the generation of other formats, like the more popular (though less enterprise-oriented) hResume microformat.

So much for Contract-First Development. Contract Guided Development is probably more appropriate now.

Current Endeavors

I currently spend my Saturdays studying for my CAPM (Certified Associate in Project Management) and ITIL Certifications. The former is on project-based work which will be useful for development roles, and the latter is for IT support and focuses on IT operations.

CAPM

CAPM is a junior Project Management certification by the Project Management Institute, and tests knowledge of the Project Management Book of Knowledge (PMBOK), and does not require actual PM experience.

The gold standard in PM certification, the Project Management Professional, requires documented 4,500 hours of Project Management work which will be subject to audit. Because my colleagues in my previous PM work have left the company, there’s no one to validate my experience. I instead opted for CAPM.

For this certification, I primarily use Rita Mulcahy’s CAPM Exam Prep Third Edition, which I had to order from Amazon because I couldn’t find this book anywhere locally. I also read Information Technology Project Management, Fourth Edition, by Kathy Shwalbe, as a supplement, and the official PM bible, A Guide to the Project Management Book of Knowledge, Third Edition, of course.

I currently am about to start on the Quality Management chapter, having finished the chapters on Introduction, Project Lifecycle, PM Processes, Integration Management, Scope Management and Cost Management.

ITIL

ITIL stands for the IT Infrastructure Library, and the certification I’m going for, ITIL Foundation, covers foundation knowlege on ITIL Service Support and ITIL Service Management processes.

My current role is in technical support, so certified knowledge in ITIL is very important. For this, I use online training materials from Skillsoft.

I currently am on Configuration Management, having finished the Service Desk and Incident Management modules.

.Net

Aside from the 2 above study tracks, I am also continuing my SCSF activities. Having finished up to the Services portion of the lab, I am going to start working on a prototype project, and I chose it to be a Resume Builder software.

I currently am studying the HR-XML standard for resumes, and am currently looking at the Resume schema. I intend to try using a XSD to SQL tool, and then use NHibernate to help out in the data access portion of the code. I will be trying out XSD.EXE from VS 2005 if it can easily generate entity classes from these documents. (I have not yet started getting into the newly released ADO.NET Entity Framework of Microsoft, as I’d like to use .Net 2.0 as the foundation for my piece.)