I've been refining the core classes in the business model, the snapshot below
illustrates the overall design of the business model. I've spent the some
upfront time making sure that I can create, load and save core classes
(Producer, Wine) to the data store. The Wine class posed a particularly
interesting problem in that it also required the loading and saving of the
contained Producer class. I didn't want the Wine class to be dependent on the
ProducerRepository, so I used the idea of a ProducerAssociate class as discussed
by
Steve Maine. To simplify the diagram, I purposely left out the
WineRepository and it's associated WineFactory class.

In this post, I want to focus on a Wine's Varietal. The
Wine Diva lists
128 grape varieties,
and in reality there are many more when you take into account regional growing
areas and clone varieties. Initially, I modeled the Varietal property as a
string on the wine class. After looking at the multitude of grape varieties, and
how some varieties are simply synonyms for others, I realized I wanted more than
just a name. So I came up with the following definition.

Now, I can query the Derivatives property to get a list of
Varietals that the grape is a synonym for. If the wine is a Blend, of say
Cabernet Sauvignon and Merlot, the Blend property will be populated, the Percent
representing the amount of one varietal versus another. I may also add a Parent
property of type Varietal which would point to the root or parent of the
Varietal. For example, Auvernat, Beaunois, Epinette Blanche, Pinot Chardonnay,
and Feiner Weiseser Burgunder are all types of the Chardonnay grape.
So how to handle this in the database? I'll start off with a
Wine table that has a foreign key to the Varietal table. If the wine is of a
Blend varietal, it will also have multiple WineVarietal records for the WineId.
I'm thinking that I'll have to put some "special" code to recognize the "Blend"
varietal, and maybe even add an IsBlend property to the Varietal class.

Next up? Tackling the Appellation issue. Of course I may not
write for awhile. I'm heading off to Barcelona for a few days, then on a bit of a
cruise. Anybody know any good sights in Barcelona or Marrakesh? Hopefully the
weather will be good, it's mighty cold here in Bellevue.
Well, I've been hard at work decorating my house for Halloween and spending a
little less time on the Virtual Cellar project. But, enough new things have come
by that I thought I should post them here.
New NUnit Iteration (2.2.1)
Via
Roy Osherove, a new version of NUnit (2.2.1) has been released. I couldn't
find it on the nunit site, but
sourceforge has a copy of it. Here's a quick summary of the changes in this
iteration
- Better VS2005 support. Code that fires events has been modified to
ensure that controls are invoked on the correct thread. We believe this will
solve many of the problems that occur when running tests under the VS 2005
debugger. NUnit can now open Visual Studio 2005 projects and solutions.
- An experimental extensibility mechanism is now provided, which allows
users to create special types of test cases and suites, marked by their own
attributes.
- Source code for NUnit reorganized into separate components. Both the gui
and console runners are now dlls for those who want to link them with their
own programs.
- Old style test cases ("Test....") are no longer recognized by default
- Added a protected constructor to Assert so those wanting to inherit from
it may do so
- Numerous bug fixes
Read
here for the full change log.
New Version of CruiseControl.Net
Via
mnissen: CruiseControl.Net 0.7 released
- Some Source Control plugins can now automatically update your source
tree for you (so no need for bootstrap builds)
- New 'triggers' system replaces old schedule
- Introduction of 'Working Directory' and 'Artifact' concepts (these are
not fully utilised yet)
- More support for relative paths
- Preliminary support for cross-server project reporting.
Read more
here.
Omondo Releases UML for Eclipse
I know this is a dotnetjunkies site, but I have to make a plug for a
great UML tool for Eclipse
and Java development, you can download the
free version here.
It now supports Eclipse v3.0.1. A Linux
Journal review is here.
Eclipse & Omondo make a great environment for Java development, including tight
integration with Ant.
Virtual Cellar
I've laid most of the foundation now for the Virtual Cellar, I'm now
beginning to flesh out the classes in the domain model. The two main classes are
the Producer class, and the Wine class. Most of the work as of late is on the
Wine class and gathering data for the different Varietals of grape. I'll post a
little about that later today.