DonXML Blog

The East Coast Don

January 2004 - Posts

Domain Model Examples For .Net

Since I made the post on Migrating from Table Models to Domain Models via OCL I’ve had a couple people ask about examples using the Domain Model with .Net.  The best book I’ve found on the subject of patterns and enterprise architecture is Martin Fowler’s PoEAA book.  Although not written just for .Net developers, it does have some .Net examples and some Java, too.  As for a real world example, I haven’t found one.  Typically I’d point to the MSDN Patterns and Practices site for this type of stuff, but I haven’t found a good Domain Model example there.  One of the things we are trying to do with the LearningXml and XmlInsiders projects is to build our websites using some of the best practices we’ve developed involving the use of XML within your application.  And one of those things is how to map your relational data to your Domain Model.  When I get some time, I’ll create an example of how I’ve been doing this.  Until then, if anyone else knows of some good domain model examples in .Net please post a comment to let the folks know about it.

Hopefully, once I get the example down, then I can use it to demonstrate some of the ideas I have about using OCL to help in the data mapping process.

DonXML Demsak


The preceding blog entry has been syndicated from the DonXML Demsak’s All Things Techie Blog.  Please post all comments on the original post.

Posted: Jan 27 2004, 11:05 AM by DonXML
Filed under:
North NJ .Net Meeting Featuring Deborah Kurata – Pre-Registration Required

If you are planning to go to February’s N3UG meeting featuring Deborah Kurata, you will need to pre-register, so that the folks at SetFocus can get a better idea on how many people to expect.

DonXML Demsak


The preceding blog entry has been syndicated from the DonXML Demsak’s All Things Techie Blog.  Please post all comments on the original post.

Posted: Jan 23 2004, 01:28 PM by DonXML
Filed under:
Dev Days and the Whidbey Version

Does anyone know if the Whidbey version that will be given out at Dev Days will be an updated version, or just the one from the PDC.  I thought one of my local MCS guys said it was going to be a new drop, but I can’t find an official post on this.

Update

As per Julia, and Laura John it is the PDC version.  Thanks Julia and Laura for the quick turnaround on this!

Posted: Jan 20 2004, 05:05 PM by DonXML | with 3 comment(s)
Filed under:
Migrating from Table Models to Domain Models via OCL

I’ve been dwelling on this idea of trying to use some variation of the Object Constraint Language within .Net, and I think I’m finally at the point where I can try to discuss it in a coherent manner.  OCL is used to describe the constraints on objects within UML, but I’d like to enhance it be used in more than UML.

One of the things I seem to find myself doing time and time again, when building multi-tier applications, is using the Data Mapper Pattern (see Martin Fowler’s PoEAA book) to map my data (retrieved from some data source using a Data Access Layer) to my Domain Model (the Line of Business Layer), but that requires quite a bit of code.  .Net does not have a tool to help in situations where the business logic is complex enough to warrant a Domain Model approach.  Instead it uses the Table Model, via Strongly Typed Datasets.  With Strongly Typed Datasets you can take an XML Schema and transform the data structure into classes.  But this approach does not work well for more complex systems, since the generated classes contain only the behaviors required to maintain the data structure.  There is no way to add business rules (aka constraints or behaviors) to the generated classes.

So, I got to thinking that the thing which was missing in the Strongly Typed Dataset approach was the business rules, and that most of the business rules can be defined using OCL.  There seems to also be a similar problem in XML Schema, where in that language they would also like to add something more than just the structure of the data.  Daniel Cazzulino has done a bunch of stuff with Schematron for .Net, and seems to be another (partial) solution to the problem.  If we can create another namespace (let’s call it eXtensible Constraint Language for now), for use within XML-Schema, then we could add the extra business rules to the schema, and be able to create a version of Strongly Typed Datasets, but one that includes these business rules.  Then as a developer, I would have the choice of using either the Table Model, or when things are a bit more complex, the Domain Model, and have tools to make coding for either model easier.

The one final thing that I see is missing is when a constraint is not met.  Currently, when validating an XML document to a Schema you will generate schema exceptions.  But in the case of constraints, I’d like to be able to do one better, and bind each constraint to exception.  But I don’t want just a list of canned exceptions, but to be able to create my own.  So we would need another language (lets call it eXentsible Exception Language) that can be used to describe the Exceptions, and the hierarchies.  Then you can bind a XCL to a XEL, and when you generate the enhanced Strongly Typed Dataset, you will get the constraints and the exceptions.  The bonus is that you can also translate the Schemas embedded with XCL and XEL to some very good system documentation, and/or generate the Schemas from UML.

Does anyone know if someone is working on something like this?  Is this something other developers are interested in, or is it just something that intrigues me?

DonXML Demsak


The preceding blog entry has been syndicated from the DonXML Demsak’s All Things Techie Blog.  Please post all comments on the original post.

Posted: Jan 15 2004, 03:32 PM by DonXML
Filed under: ,
Dottext.Web.HttpCompression

Jeff Jullian created a .Text plugin so that you can combine Ben Lowery's HttpCompression and ScottW's .Text version 0.95.  What it will do for you is compress only the rss feeds, and not the other aspx pages, so you avoid the Server.Transfer issues that HttpCompression can suffer (well, MS has a hotfix, but not all hosting providers have it installed see Ben's article.).

DonXML Demsak


The preceding blog entry has been syndicated from the DonXML Demsak’s All Things Techie Blog.  Please post all comments on the original post.
NYC .Net Meeting Thursday, Jan. 15th

I’m going to the NYC .Net meeting (which I usually don’t do since it is quite a commute) on Thursday.  Scott Hansleman (sponsored by INETA) is presenting a session on the Zen and Art of Web Services (got to show support for my homies).  I wonder if Rory will try to stow away in Scott’s luggage.  If anyone wants to get together, contact me, or just meet me at the meeting.

Oh, and I’ll be at the regular Tuesday night North NJ .Net meeting, too.  Jeff Lyttle is doing a session on CLR integration in Yukon.  I was scheduled to do a presentation there next month, but I think Deborah Kurata is available thru INETA for that month, so I’m differing my presentation until later.

DonXML Demsak


  The preceding blog entry has been syndicated from the DonXML Demsak’s All Things Techie Blog.  Please post all comments on the original post.

Posted: Jan 10 2004, 03:31 PM by DonXML
Filed under:
OneNote For Blogging

I’m sure others have thought of this, but OneNote would be an excellent tool for a blogging editor, except for the fact that the API isn’t public.  I use OneNote all the time to jot done my blog entries, and then copy and paste them into the my site.  I’d like to create a plugin for OneNote to post to my blog via the SOAP APIs, but since the OneNote APIs are private that can not be done.  Yes I know that I could save it to a mht file, and write a script to parse it and post it to my site, but that’s a kludge.  It would be so much better to do it right from OneNote.  I see that Don Box is creating an XSLT to convert WordML to XHTML, which is another possibility, if I wrap that in a Word Macro that can post to my site.  Maybe that is something that I should tackle this week.

DonXML Demsak


  The preceding blog entry has been syndicated from the DonXML Demsak’s All Things Techie Blog.  Please post all comments on the original post, and not this one.

Posted: Jan 05 2004, 09:49 AM by DonXML
Filed under: ,
More Posts