Archive

Archive for August, 2008

GOF Series: Episode #2 [The Abstract Factory]

August 7th, 2008 Simon Segal No comments

The pattern a day keeps the doctor away series continues. In the last instalment of the series we looked at the Factory Method pattern, this time we look at the Abstract Factory Pattern. The abstract Factory Pattern is useful in creating groups of related object types without a requirement to create their concrete types explicitly and achieves this by using composition where a class delegates the role of object instantiation to another class. This pattern can be described in UML like this:

Click to see in full size

The tests included (as per below) are for the purpose of demonstrating the code and are not meant to be taken as complete unit tests.

   1:  [Test]
   2:  public void AbstractFactoryTest()
   3:  {
   4:      //set an earlier time to that 
   5:      //when the document is created
   6:      DateTime earlier = 
   7:          DateTime.Now.Subtract(new TimeSpan(0, 1, 0));
   8:      //create the mock of the AncillaryService
   9:      var mock = 
  10:          new Mock<AncillaryService>(new 
  11:              LitigationSupportFactory());
  12:      mock.Object.
  13:          SetupProject("My Test Lit Support Project");
  14:      //use the factory method that create a new document
  15:      //using the mock instance object.
  16:      Document litDoc = 
  17:          mock.Object.
  18:          NewDocument("Lit Support Test Document");
  19:      mock.Object.
  20:          PersistDocument(litDoc);
  21:      //perform the tests for 
  22:      //the Lit support factory
  23:      //and the client (AncillaryService) 
  24:      //that has it in its composite.
  25:      Assert.IsTrue(litDoc is LitigationSupportDocument);
  26:      Assert.IsTrue(litDoc.Name == "Lit Support Test Document");
  27:      Assert.That(litDoc.DateCreated.Value > earlier);
  28:      Assert.IsTrue(File.Exists
  29:          (@"C:\DevFileDrop\Lit Support Test Document.litdoc"));
  30:   
  31:      mock = 
  32:          new Mock<AncillaryService>(
  33:              new ImageWorkflowFactory());
  34:      mock.Object.SetupProject("My Test IW Project");
  35:      ImageWorkflowDocument iwDoc = 
  36:          mock.Object.
  37:          NewDocument("IW Test Document") 
  38:          as ImageWorkflowDocument;
  39:      mock.Object.PersistAll();
  40:      Assert.IsTrue(iwDoc != null);
  41:      Assert.IsTrue(iwDoc.Name == "IW Test Document");
  42:      Assert.That(iwDoc.DateCreated.Value > earlier);
  43:      Assert.IsTrue(File.Exists
  44:          (@"C:\DevFileDrop\IW Test Document.iwdoc"));
  45:  }

The code above assumes the AncillaryService, LitigationSupportFactory and ImageWorkflowFactory classes (which are indeed in the download code. The link to the FULL example code can be found here and comes with all previous modules in the series and the accompanying power point presentation to explain each pattern in detail, so I wont repeat that content here.

Share/Save/Bookmark

Do I need a Distributed Systems Concept Map? Damn straight I do.

August 5th, 2008 Simon Segal No comments

Udi Dahan (creator of nServiceBus) has recently posted an early look at a concept map for distributed Good Idea!systems. Udi is also proposing developing a more interactive version which will  link to resources that discuss the concepts in more depth. Looking at Udi’s first draft, I have to say that I think this a great idea and something I would love to have at my fingertips for a number of reasons. Sure the interactive resources will be great and I think it would be worth it’s weight in gold as a portable architects scratch pad reminder; if I could just stir it into my coffee every morning!

I hope Udi takes this idea to the next step.

Share/Save/Bookmark

Categories: Distributed, SOA Tags: ,

Oslo, SOA, BizTalk Express and crossing the chasm (part 2).

August 3rd, 2008 Simon Segal 2 comments

PDC announcements have been made that begin to shed some light (small aperture stuff) on the whole mystery on OSLO. However before I get into discussing what might become apparent at the PDC let me digress a moment into a discussion on what constitutes an Enterprise and whether SOA is exclusively a valid Enterprise concept.

What constitutes an Enterprise?

3 Developers, 80 staff, 12 million per annum revenue == Enterprise ?

5 Developers, 120 staff, 17 million per annum revenue == Enterprise ?

7 Developers, 200 staff, 22 million per annum revenue == Enterprise ?

10, Developers, 300 staff, 50 million per annum revenue == Enterprise ?

15 Developers, 1000 staff, etc ?

What’s interesting to me is that you will find development teams and managers in any of the categories above, that want to connect applications in the organisation  (enterprise or whatever you want to call it) and believe that they are equally entitled to be thinking about SOA as the CIO of any large Telco or public / private Utility.

Recently I posted a suggestion that if BizTalk had an express version, then it would have "crossed the chasm" en masse some time ago. The question I pose now ismaxShoePhone what are Microsoft’s plan for BizTalk licensing given the positioning they have given the product within the context of Oslo? Based on the official documentation to date and working on the assumption that there is no change to the status quo to the licensing strategy around BizTalk, then Oslo seems to be limiting it’s audience somewhat. Quite a few of the organisations (Enterprise) listed above, will have a hard time justifying the cost of BizTalk licensing and will be faced with finding alternatives. Let’s face it, there are more businesses in these categories above than any other and it’s also representative of the vast majority of Microsoft’s constituency, so the questions have to be asked, just how central to Oslo will BizTalk be and what will it cost? I note that the roadmap does not include answers to these questions and I dare say that the PDC wont devote a lot of attention to it either but here’s hoping.

The technology that lies at the heart of Oslo is being listed as BizTalk Server V6, System Centre V5, Visual Studio V10, BizTalk Services V1, and the .NET 4.0  Framework. Oslo seems constrained to providing updates to existing technology and providing some new ones, both forming the parts in creating your own SOA soup. Certainly there seems to be no mention or evidence of a framework per se and IIronFramework cant help but wonder if this isn’t one of the missing elements in their general approach. Certainly it has opened up the way for both open source and 3rd party commercial frameworks / products such as nServiceBus, Simple Service Bus, Neudesic Neuron ESB, Mass Transit and Linxter amongst them. I know nServiceBus reasonable well and it  addresses some of the key problems when faced with building a fluent service based eco system in your organisation and whilst it is early days yet, I can help but notice that Redmond would appear to be taking a heavily technological approach to the problem space. My hope is that the idea of messaging being about web services ‘everywhere’ with a whole lot of orchestration, becomes consigned to the past and that we become the beneficiaries of real pub sub with WCF providing the message transports and perhaps even BizTalk Express filling in the durable pub / sub piece of the architecture?

Some of the things imagineered into Oslo so far are BizTalk deployment of Workflow to Server farms, BAM type monitoring of Workflow, more visual Workflow design tools and an online repository for storage of message contracts , workflow’s, service publications /subscriptions and discovery (ciao UDDI?).

I look forward to seeing what the PDC will unveil and hopefully Microsoft will keep the process open to some rich community input.

Share/Save/Bookmark

Creative Commons Attribution-ShareAlike 2.5 Australia
Creative Commons Attribution-ShareAlike 2.5 Australia