April 2004 - Posts
This and the next few weeks will be fairly hectic. The first beta of my Tracking & Tracing System will be demonstrated at the Victam event which will be held from 11th – 13 th of May. Victam is the global event for supplying the Feed and Food Chain. The system will demonstrating which supplier ingredient lots composed a batch. Which batches did feed a pallet, bin etc? Which batches ran on this particular piece of equipment? What was the effect of this badly performing production line on production and how can we use this information to optimize the next production run? The resulting information by asking these questions against the Tracing System are vital in a calamity scenario. A worst case calamity could for instance be initiated by one of your customers, which reports a problem with delivered goods. Remember the Dioxine scandal?
What we basically do is track information (often referred as Tracking) accumulated from material flows, process inventory and other ERP (Enterprise Resource Planning) related functions, quality control, and the batch recipe execution system. Once this information is being analyzed in the higher level tool, Tracing, we are able to reconstruct the product genealogy with all its process, quality, storage etc parameters, and routes the products passed in the value chain. In short we are able to trace a certain set of information which describes a single batch, back to the raw materials it consumed and all in between (upstream tracing). We can even trace further to the previous link in the supply chain (mostly the supplier of raw or prefab materials). We can point our finger and trace downstream to all customers that where as well supplied with “potentially” dangerous finished goods (without lab results which often take days you can’t do anything else other then to execute this aggressive Tracking & Tracing strategy). At the same time we can trace our production lines and pull back prefabs and finished goods still in the production system, clean and publish detailed reporting. The Tracing system is capable of tracing across areas decentralized across the globe (think SOA).
The previously “brief” description of Tracking & Tracing is often referred as executing a Recall 1 and a Recall 2 which I’ll discuss in more detail in a future post.
Both the Tracking and Tracing system are written in C# .NET each containing ten thousand lines of code. I worked for 1 ½ year fulltime on this system and it’s about to see the light! We ditched our test data (primarily used for Unit testing) earlier this week and have been running 24/7 since then with live production data.
Ps: Notice my new summer themed skin
I’m am working with my client on integrating their VB6 based solutions with my Tracking & Tracing System. We use MSMQ technology to integrate several nodes supplying Tracking data to the system (my reading tip for this week: Enterprise Integration Patterns). I ran into this exception earlier this morning:
System.InvalidOperationException: Cannot deserialize the message passed as an argument. Cannot recognize the serialization format.
It appears that the XmlMessageFormatter doesn’t swallow messages send by a VB6 client which uses the MSMQ COM Component. The solution to this formatting problem is the ActiveXMessageFormatter class, interoperable with MSMQ COM. I could decide to send and receive messages using this interoperable formatter within my .NET code, but I decided use a fallback block instead.
private string FormatMessageQueuingMessageToXml(Message message)
{
try
{
string formattedMessage = "";
try
{
message.Formatter = new XmlMessageFormatter(new Type[] {typeof(string)});
formattedMessage = message.Body.ToString();
}
// allow interoperability with applications that use the MSMQ COM control
catch(InvalidOperationException)
{
message.Formatter = new ActiveXMessageFormatter();
formattedMessage = message.Body.ToString();
}
return formattedMessage;
}
catch(Exception ex)
{
throw new TrackingException("Failed to format Message to an XML representation.", ex);
}
}
Me and Kitty are of to Scheveningen where the Dutch version of The Lion King is displayed later this afternoon.
A good night of sleep made me think about using Typed DataSets instead of custom entities for last nights application.
This evening I started working on my companies first .NET application. As you might know I’m (besides my employment at object automation) partner at Connexx, where we still have not made the transition to .NET. Al our projects are ASP 2.0 based and I have, for years, felt quit comfortable with this knowledge (can you imagine?). Though lately we started outsourcing bits of work. It must be a living hell for our Russian (very talented) programmer Sergey to dig in my old ASP scripts. Let alone add functionality without braking stuff. I mostly use a fancy ASP aware IDE, drag and drop most of the interface together and viola. Of course I then still need to tweak the generated stuff a bit and add some additional functionality though the majority of work is done.
Since education in The Netherlands is transforming into students achieving competences instead of passing tests, the demand on competence based student tracking systems is increasing. To give you a clue what I’m working on at the moment ;)
So I have this spec lying in front of me (we did the planning game earlier), figuring out what problems this application should be capable of solving for my dear customer. Since I’m all into TDD (Test Driven Design), where Jimmy prefers to name it Test Driven Development, I decide to do a bit of prototyping first because I have no clue what all this text means. I can’t call my coworker (who knows more then I do about this project since he talked to my customer)… not all people are crazy enough spending their Saturday evening on “work”, hobby, passion, whatever. My brain is capable of capturing about 3 requirements with all their “booby traps” for at least half an hour depending on the amount of coffee I “tanked”. More then enough time to write the interface for a small part of this to become Competence System. In a previous live I would boot a Visio session and start drafting a bit of UML and ER diagrams but then later I would fall back and think… boy those designs where so useless ;) I would probably spend the rest of this evening drafting and remove it from my disk tomorrow morning, repeating this cycle until the deadline comes in sight.
I decide to write a few lines of code starting with a class containing a few static methods composing a data structure used for testing later on. I could use Mock objects, but do I really need them? I haven’t decided on a database format nor the user interface (ok it’ll be webclient / webservice) but 99,9% of the time I can eliminate the need for Mock objects as a whole by refactoring my test code. Decision made, no Mock objects for now. Business Logic here I come.
After writing the first lines of code I’m slowly falling back on the spec document. For some reason the text seems to make more sense now, let’s take a closer look. I refactoring my simple testing code a bit more and notice I’m totally overlooking boundary checks. I really don’t feel like getting into details right now (but identify potential showstoppers) , so I comment all things I can think of in todo comments. These let me improve existing tests whenever I feel like it or when nasty bugs start to spoil my pleasure (and trust me they’ll be there when the shipping date arrives).
Motivation goes down, I decide to instead of throwing an NotImplementedException, to return 0 as the result value in this algorithm. I just don’t know how it's intended to work by reading the text in the spec. I need both a whiteboard and a soundboard to figure this one out, and my home office (lol, more like the uncomfortable corner I’m sitting in right now) doesn’t have either one of them. This algorithm already feels complex and needs to be separated in a few blocks. I think Strategy to reuse a few pieces across the business tier, but it’s way to early to make comfortable decisions. A pattern is good for tackling complexity, but could introduce additional complexity if it doesn’t properly fit in the whole. But hey, there still are a few bars lighting up green so it wasn’t all for nothing!
Would this be what Jimmy means by saying TDD is fun? If I only got paid for this Saturday night craziness :D
Few, what a drive (a total of 5 hours)! I just got back from the Dutch dotNED meeting where we learned about Model View Controller & .NET/J2EE integration where I couldn’t connect the two in a single presentation, but that should be fine. According to Hassan Fadili interoperability “just works”. What a relieve :D
Sander van de Velde demonstrated Delphi ECO (Enterprise Core Objects), cutting edge technology from Borland. I had a little chat with Sander afterwards where he explained a bit more about ECO. ECO forces developers to work model centric (MDA) where most of the nowadays object relational mapping frameworks lean against data centric development. LLBLGen Pro for instance is at its best by first designing your data model in conjunction with your use case scenario’s and then map against classes. I now know Delphi 8 is an interesting alternative for developing on top of the .NET platform. So I suggest MS to start fixing those nasty IDE bugs in VS.NET 2003, otherwise you have one less customer ;)
Finally Marc van Gulik had a few things to say about .NET Remoting. He had Advanced .NET Remoting by Ingo Rammer (great book, a must have, we already knew that Michiel) laying demonstratively right next to him which was definitely the base for his talk. Unfortunately he didn’t explain why we should use remoting in this SOA hyped world. Why we want, and in some scenarios need complete transparency for our objects (see OAenterprise, our product which does a great job doing so). I asked him about what could possibly cause this nasty bug I had earlier this morning by throwing custom exception via remoting boundaries on top of 1.1. I’ll blog about that later. It appears to be a configuration issue related to security.
*Update
And Peter was there as well, and made a few shots!
I’ve just checked Chriss Sells, MSDN tour. I now feel much better about my own office space :D
Very cool stuff Chris!
Bary: The performance hit is not ~30%. You’ll have to dig a bit further within what context this statement was made by (I think Dino). I’ve written my own object relational mapping framework so I could say a thing or two about what you’ll run into writing one yourself or building your application on top of a top notch framework like LLBLGen Pro. The hardest part would be data binding. You should think hard, in case you are utilizing standard WinForm controls. Trust me that writing the glue between your domain and gui’s is a tedious task. Concurrency control is fairly doable. Martin Fowler wrote a nice topic about Unit of Work, which will probably suit your needs in regard to concurrency control. While you’re at his book, please check out his diagram of complexity and in which particular case you would benefit from a rich domain model on top of your custom entities. The tools are there to help you but roundtrip engineering is hard or even impossible in some cases. LLBLGen Pro does a good job by inheriting entity classes and lets you factor your specific logic into these inherited entity classes. I personally don’t like this approach, I’d rather have framework, attribute or inheritance based so that the way of handling persistence is somewhat more explicit. This is where Entity Broker and ObjectSpaces come to mind. Wilson did an excellent job with his ObjectSpaces complaint persistence framework, but I’d rather not use it production system (not yet that is).
I’m currently working on a system with typed DataSets using ADO.NET Powertools. I inherit from a base DataSet, so I have a natural place to store “logic”, note that you would otherwise store this in the business logic layer. Although I’m an object bigot (a person who is religiously attached) and would trade this solution any day, any time I’m aware of the amount of code I’m getting right out of the box. My data layer is incredibly thin due the extensive use of the CommandBuilder (performance wise not the smartest thing but it only takes 3 lines of code to do). The business logic layer is the place where it tends to get messy, but this is only the case for increased complexity. Passing DataSet’s between layers is smooth, XML aware and more important: typed.
For those interested in object relational mapping… check Jimmy’s blog frequently! A very well documented, made the right tradeoffs early in the design phase, C# based framework is coming our way (probably free/open source).
ObjectSpaces, where are though? In the meanwhile, Bary has a great post about the p/c's about DataSet's.
Ever felt the urge to comment on your favorite books? Why not join the .NET Book Club.
http://www.w3.org/ -- 7 April 2004 -- Leading the Web to its full potential, the World Wide Web Consortium (W3C) today released the Document Object Model Level 3 Core and Load and Save specifications as W3C Recommendations. The specifications reflect cross-industry agreement on a standard API (Applications Programming Interface) for manipulating documents and data through a programming language (such as Java or ECMAScript). A W3C Recommendation indicates that a specification is stable, contributes to Web interoperability, and has been reviewed by the W3C Membership, who favor its adoption by the industry.
Read more here: http://www.w3.org/2004/03/dom-level-3-pr
The enhanced schema support does it for me!
A colleague of mine who wishes to remain anonymous (he's a bit ashamed of targeting VB6) found a few significant flaws in this MSDN Knowledge Base article. Can you locate them ;)
More Posts
Next page »