November 24, 2008
@ 08:14 PM

Well, I finally did it. I went over to the darkside and picked up a 15" MacBook Pro and a copy of VMWare Fusion. I got the box home and had a Bootcamp partition with Windows 2008 Workstation installed within an hour. Install Visual Studio 2008 and I was ready to do some development in one Space while working on Keynote presentations in another.

My journey though Mac software beings. I sit here now typing this up in a very nice blog post editor called Ecto. It's all good.

Look for more post as I explore the developer tools on the Mac.


 
Categories: Development | Random | Tools

November 11, 2008
@ 07:36 AM

Don't forget about Seattle Code Camp v4.0 this weekend in Redmond.  For all the details, go to the Seattle Code Camp website.  This is a free weekend of presentations on a wide variety of software development subjects.  This isn't a 'Microsoft' only event, check out the list of sessions if you don't believe me.

Two South Sound .NET User Group members will be presenting:

Chris Bilson is presenting 'Getting Git'

Git is a distributed version control system. It's a little different than other source control systems you may have used (Subversion, TFS, etc.), and a little more powerful too. In this session we'll talk a little bit about what the big deal is with distributed revision control systems, which ones exist, git, some tools related to git, web sites that work with git, and go through a typical git workflow.

Camey Combs is presenting "What's the Big EFing Deal? Even Newbies can do Entity Framework"

Have you done anything with Entity Framework yet? Have you heard of it? Curious about it? if you're new to EF and want to do some coding utilizing it, this is the session for you. Come and see what a newbie (you and your presenter) can do with EF after only a few short lessons. Bring your laptop loaded up and ready to go and follow along, building your own simple applications using EF.


 
Categories: Development | Events | Local

Please join us on Thursday, November 13th for a presentation on MVC by Chris Tavares.


Meeting Summary:
The ASP.NET Model-View-Controller (MVC) framework is a new web development framework that sits next to the existing ASP.NET WebForms framework. Rather than attempting to abstract away the Web, MVC embraces the web programming model. The result is a very different experience for writing web applications on the .NET platform. In this talk, we’ll look at what the MVC framework is, the basics of how to use it, why it exists, and how to decide whether to use it (or not).

Speaker Info:
Chris is a developer on the Microsoft patterns & practices team. He started his obsession with computers in third grade with an actual teletype taking to a mainframe. The job has gotten rather easier since. He’s worked in embedded systems, shrink wrap software, developer tools, consulting, and as a developer trainer before joining Microsoft. His current projects are as dev lead / architect for Microsoft’s Enterprise Library, and consulting software designer on the ASP.NET MVC framework.

Meeting Specifics:
November 13th, 7 - 9 PM
Olympia Center (222 Columbia NW)
All attendees are eligible for the prize drawings. Past prizes have included technical books, passes to Devscovery, copies of Visual Studio, Vista, Office 2007 and more.


Don't forget to let your friends and co-workers know about this meeting.  Feel free to forward this email and/or direct them to www.ssdotnet.org for more information.


 
Categories: Development | Events | Local

November 6, 2008
@ 08:39 PM


 
Categories: Commentary | Performace | Random

I have assembly A with class Z that inherits from class X in assembly B. Now in a completely different solution, I have assembly C, which uses class Z.

The compiler complains unless assembly C has a reference to both assembly A & B. Even though assembly C does not use class Z directly in anyway.

Is this expected?

It seems to me that if assembly B is missing at run time stuff blows up, but at compile time it shouldn't care.

What am I missing here?

My goal is that I can tell my clients to depend on class Z in assembly A, but I can completely reconfigure my assemblies on the other side and have no effect at all on the client when they upgrade.


 
Categories: Development

I have the following solution project structure:

  • Application.Core.Entities
  • Application.Xtend.CustomerName.Entities

In the Core project I have an entity Customer defiend. In the XTend project, I have an entity defined that subclasses Customer named xCustomer (for lack of a better name at this time...).

The idea here is that we have a Core domain model in our application. A customer can then create a new assembly that contains extensions to our core model. When the extension assembly is present a smart IRepository class will return a subclass of the core class instead.

I am attempting to map this relationship in NHibernate. Using Fluent NHibernate I was able to generate this mapping:

 

<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   default-lazy="false"
                   assembly="NHibernate.Core.Entites"
                   namespace="NHibernate.Entites"
                   default-access="field.camelcase-underscore">
  <!-- Customer is located in assembly Application.Core.Entities -->
  <class name="Customer" table="Customers" 
        xmlns="urn:nhibernate-mapping-2.2">
    <id name="Id" column="Id" type="Int64">
      <generator class="native" />
    </id>
    <component name="Name" insert="true" update="true">
      <property name="LastName" column="LastName" length="255"
                type="String" not-null="true">
        <column name="LastName" />
      </property>
      <property name="FirstName" column="FirstName" length="255"
                type="String" not-null="true">
        <column name="FirstName" />
      </property>
    </component>
    <!-- xCustomer is located in assembly Application.XTend.CustomerName.Entities -->
    <joined-subclass name="xCustomer" table="xCustomer">
      <key column="CustomerId" />
      <property name="CustomerType" column="CustomerType"
                length="255" type="String" not-null="true">
        <column name="CustomerType" />
      </property>
    </joined-subclass>
  </class>
</hibernate-mapping>

But NHib throws the following error:

NHibernate.MappingException: persistent class Application.Entites.xCustomer, Application.Core.Entites not found ---> System.TypeLoadException: Could not load type 'Application.Entites.xCustomer' from assembly 'Application.Core.Entites, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'..

Which makes sense xCustomer is not defined in the Core library. I took my quandary to the NHibernate Users mailing list and StackOverflow. After some helpful suggestions and pointers, I discovered that the solution was so obvious that I am somewhat embarrassed that I couldn't see it.

The hibernate-mapping attributes assembly and namespace are convenient short cuts that allow you to not have to fully qualify your class names. This lets you have the nice mark up , but the name attribute of both class and joined-subclass elements can take a fully qualified assembly name as well.

So the above broken mapping file can be fixed like so:

 

<joined-subclass name="Application.XTend.CustomerName.Entities.xCustomer, 
                 Application.XTend.CustomerName.Entities, Version=1.0.0.0, 
                 Culture=neutral, PublicKeyToken=null" 
                 table="xCustomer">
  <key column="CustomerId" />
  <property name="CustomerType" column="CustomerType" length="255" 
            type="String" not-null="true">
    <column name="CustomerType" />
  </property>
</joined-subclass>

This works as I expected it to. So I then took a look at the Fluent-NHibernate source and created a patch complete with working unit tests to resolve the issue and submitted it to the project.

So at the end of the day, I learned something about NHibernate and the Fluent-NHibernate team got a patch to resolve and obscure bug.


 
Categories: Development | NHibernate