Archive for March, 2008


WCF Service Software Factory thoughts…

March 24, 2008

Today, I completed a hands on lab from codeplex that shows off the features of what the service factory can do. The reason why I did this tutorial is that I have decided to strengthen my career with WCF and SOA and to also try and strengthen my architect skills. The reason why I picked the service software factory for part of my studies is a few reasons:

  • It’s new to me. I have been too scared to use it in production environments because of my lack of knowledge about it
  • It’s Guidance automation packages are extensible and are very focused for the decision makers/architects
  • It provides a lot of code generation and task automation of some of the monotonous things that programming in WCF can sometimes make you feel. i.e. it will probably take you 2+ hours to just THINK about how many projects you will have, what to call them, and how to layout your solution in general.

So after I have finished it I am now left with a question in my head. I do not have anyone that works with me currently that is at a very high architect’s level or works with one so I cannot ask the question to colleagues. My question is: How realistic is the use of the software factory to create production systems. Sure it’s enterprise level but how easy would it be to make code changes to already generated files? Yes it can be done, but then you can no longer re-generate the file with the software factory or else your changes get overwritten. How stable are these tools when code files start to hit the hundred’s and dependency complexity between files and projects increases? I understand the code is open source and that any potentially blocking issues could theoretically be fixed but that’s beside the point. I would love to know how many architects/senior developers actually produce production code for large projects (by large I mean enterprise level, million dollar plus projects). My personal view on this is split in two. On one hand I love the fact that I’m no longer writing the word ‘public <return type> <method Name>{//blab la };’ constantly and that it is automatically generated for me. It makes me feel very productive. I love the fact that I can just click on a Guidance Automation Task project type and know that I am adhering to “best practises” without having to think about structuring my solution myself ( I know that one should always consider each scenario individually and that these projects can be modified via recipes etc). I become worried when thinking about what happens when you need to modify the automatically generated code. I become worried when I think about the readability and quality of generated code. I also worry about how reliable these automation tools are. Finally I worry about the fact that I’m not sure how many senior developers out there actually use the software factory. In my limited 6 years of developing I have only come across one developer that has used it and he wasn’t a developer, he was actually an architect/senior consultant.


I will be taking the safer option for now by continuously trying to improve my WCF skills and knowledge without worrying too much about learning about the software factory until I meet some more senior architects that can swear by it and maybe even visually show me some implementations on some projects and how it positively affected productivity.


Font Application Idea

March 9, 2008

I would like to create an application that simulates a human’s handwriting. Currently Windows Fonts do not have support for this. Ideally what I would like to have the ability to do as a developer is simply provide versions of a font and have the font randomly display a version of the letters to me as I type. For example I would create a font called Robert’s Handwriting font and instead of giving it 1 single style for every letter of the alphabet, I would provide at least 10 closely matched styles per letter. When using the font to type in an application, the font would randomly choose from the 10 a’s or 10 b’s or 10 c’s or whatever key the user pressed and display it. That way you could slightly simulate a more natural/real font. Obviously this isn’t a trivial task that I can easily take on but I have thought of a work around in which I think *may* work. What I plan to do is write a little applet that sits in the task bar, the idea is that you launch it and also open word. From here you would turn on “human handwriting” in the application and what it would do is capture each of your key strokes silently and using word automation (please keep reading and don’t stop yet =] I know word automation is ugly 😉 ) it would change MS Word’s font on every
key stroke. I am excited to see if this would work. I am concerned that it may be very CPU heavy when speed typists like myself can type over 100 words per minute. I will report back when I get time to launch this little side project.



March 8, 2008

The other day I tried to implement LINQ To XSD 0.1 alpha into my production code. I was trying to achieve a strongly typed xml development experience. I failed and gave up. I am not sure where I went wrong but there isn’t really too much clear and simple documentation out there on how to integrate it into your project.

Ofcourse,The first thing I did was hit LINQ To XSD in google and click on the first link. After reading some fairly easy instructions I download the necessary msi packages, install them and ‘infer a schema’ from my XML. Here is where I believe I’m missing a step. It appears all the examples I am looking at do something like this

var xmlSource = XDocument.load(uri);

var xmlTree = from x in xmlSource

                     select xmlSource.SomeStronglyTypedProperty;

and hey presto it all works. Well, for me ofcourse, I don’t get my strongly typed properties. It appears I’m missing a step where I have to do something in visual studio to use the strongly typed class rather than the late bound one.

Also. Some questionable usability points about the XDocument class. First of all, the nitty gritty. Why does the method XDocument.Load’s parameter take a string when it’s a URI? I believe URI would be an appropriate data type unless there is a reason for it? Secondly, in my application I have 3 projects. A database project, a “core” business class project and a front end project. When trying to work with XML and XSD files I created my XML file called FlashBanner.xml in my core project and also saved the inferred schema FlashBanner.xsd next to it in the core project. But the problem is I don’t have any easy way to reference anything in the core through URI. Rather an overload of XDocument.Load(string FilePath) would be nice. As a quick work around I ended up creating an xml folder in my project but I would much prefer to keep files like that in my core project.

Other then the fact that I couldn’t get it to work and that there doesn’t appear to be any easily found and read information on how to use it, Thanks to Visual Studio’s automatic “Infer Schema” doing all the work, LINQ To XSD looks like a technology that I would be using absolutely anywhere and everywhere.


Technorati Tags: , , , ,


LINQ To SQL requires Primary Key!

March 6, 2008

After 8 months of playing with LINQ I have only JUST found out that LINQ To SQL *Requires* a primary key on every table. This includes many to many mapping tables!

I only found this out by accident after forgetting to mark my ID column as PK. I guess this means that my good practice of putting a Primary key on every table is a good one! =]