in

 

Sean Chambers

I am a Lead Developer from Palm Coast Florida. If I could describe my skillset I would include TDD, DDD, Alt.net, NHibernate, Castle Project and so on

September 2007 - Posts

  • Organizing Namespaces with DDD

    About a week ago I posted a message to the Yahoo DDD group to see how other people were organizing their namespaces in their Domain Model. For the most part everyone had the same basic idea. You can read the message here.

    In the domain layer, the general consensus seems to be to organize your namespaces around aggregates and/or entities. Not around lower level ideas like "interfaces", or "services". You can do this once you break it out into entities, but the first layer or organization should not be around low level organization. Here is an example of how I would setup namespaces in a Blog engine project. After some refining and trying a couple of different ideas I find that this works best for me.

    BlogEngine.Core (root namespace for domain model)

    BlogEngine.Core.Blog
    - IPost
    - BlogPost
    - PodcastPost
    - IComment
    - Comment BlogEngine.Core.Blog.Exceptions
    - BlogNotFoundException
    - CommentsNotAllowedException

    BlogEngine.Core.Blog.Repository
    - BlogRepository

    BlogEngine.Core.Blog.Services
    - SomeBlogService

    BlogEngine.Core.User
    - IUser
    - User
    - UserDetails

    BlogEngine.Core.User.Exceptions
    - UserNotFoundException

    BlogEngine.Core.User.Services
    - UserAuthenticationService

    And so on. This gives you a nice clear view of your dependencies between aggregates. In each of the User/UserDetails classes, you can clearly see what other aggregates it depends on. I would go even further to say I would seperate interfaces within the aggregate. But this is a task for another day. I would be very interested to hear everyones comments on this. I think everyone uses the same basic ideas but perhaps someone has a better way of doing this that would help enlighten the rest of us =)

    Posted Sep 29 2007, 09:33 AM by schambers with 12 comment(s)
    Filed under:
  • Branching a trunk permanently

    I am wondering how someone else would achieve what I am trying to do here. Basically I have a development trunk for Project A. It is updated with new code on a daily basis and has frequent branches and merges for various features etc..

    I have taken a project trunk and created a completely new project from it. I am doing this because the new trunk will go off it's own development path and I don't want modifications on Project B to create problems in Project A. In addition, namespaces in Project B will be different. This part is no problem. The problem I have is how to effeciently transmit updates to code from one project to the other. From time to time there may be new features added that I want to add to one project or the other but not all the time.

    I thought about using patches and haven't thought about it much recently. I'm at the point now where Project A has quite a few features that I wish to add to Project B without having to copy and paste code although this is what I may have to resort too.

    I guess the bottom line is, there feels like there is an easier way to do this, if there is I haven't found it yet =)

  • Another reason to love MonoRail

    W3C Validation is easy!!

    I won't mention the site that I am fixing validation for because it is in a horrid state and I am quite embarassed =)

    The fact of the matter is, I fixed quite a few errors in moments simply by modifying my NVelocity templates. This is how it was meant to be!

    A number of years ago (~2000), I worked at a web design company and worked mainly with PHP and MySql. There was a templating engine that I believe is still widely used with PHP called SmartyTemplate. This was a great feature that I think is underrated, not only for PHP but for any web based language. It allowed you to have seperate template files and used basic variable notation to display data that was generated from the PHP file. This way you seperated all of your logic from your presentation. It made for a very nice seperation, especially in PHP where people were used to mixing presentation code with application code.

    I feel very strongly about having a template display my content for me. It enforces you to not be able to mix application code with presentation code which isn't the case with asp.net.

    When I first started to play with MonoRail I decided to use NVelocity over Brail. This was because Brail allowed you to mix the two together but only in a very slight degree, as well as the fact that it seemed (at the time), there was more support for nvelocity. This is one area that I would really like to see alot of attention when Microsoft comes out with their new MVC framework. Without a proper templating engine I firmly believe that little can be gained from the solution as a whole. Not because it doesn't have a templating engine, but because no matter how the say it "should" be used, people will abuse it and dillute the whole idea of having an ignorant template and slowly begin to create poor MVC architectures and think they are doing it correctly which Microsoft will probably help along a bit.

    I digress from the main topic though, letting my dislike for Microsoft methodologies get the best of me =)

    Bottom line is, your template should be basic and "dumb" so to speak. It shouldn't know how to retrieve data, or even think about going about performing any complex application logic. MonoRail and NVelocity to the rescue!!

  • Welcome Colin Ramsay!

    Everyone at LosTechies would like to welcome Colin Ramsay to Los Techies!

    Colin has his own website where he has a number of screencasts about various topics. If you want to get learning The Castle Project quickly then check out some of his awesome screencasts at his website. His website can be found at http://www.colinramsay.co.uk/

    Welcome once again Colin! We hope you enjoy your stay at Los Techies!

    Posted Sep 25 2007, 05:34 PM by schambers with 7 comment(s)
    Filed under:
  • NAnt Build Prompter

    This is a very basic script that a co-worker named Rabid made for me. I don't know this syntax but he does for all the group policy stuff we have at work. Basically the way I had it setup to manually do nant builds was I had three seperate .bat files. That did the following:

    • One for copying the build to the staging server
    • One for copying the build to the deployment server
    • One for doing a complete build and then copying to the staging server

    It was kind of a pain to have seperate bat files because then I had to run a specific one depending on the build/deployment I wanted. So this is the script that a co-worker came up with NAnt Build Prompter

    You can download it from my GoogleCode repository here : http://schambers.googlecode.com/svn/trunk/Tools/clickToBuild.bat

    The only thing you have to do is open the bat file, and change the path to nant.exe. The file is setup now with the following folder structure:
    - trunk
    --lib\nant\nant.exe
    - branches
    - tags
    - clickToBuild.bat
    - default.build

    You only have to open the file and change the path to nant.exe. Maybe there is an easier way to do this but I haven't tried it yet. Just thought I would share this as I have found it useful. Up to this point I just had 3 separate bat files. One for each build target. This is all running on my build server that is also running CruiseControl so when I need to update the production server, I log into the build server and kick off the deployment target.

    If anyone wants to see the build file I am using let me know. It's pretty much setup as a template now that I just copy to a new project and then change the variables. I'm sure everyone probably has something similar though.

  • 500gb MyBook external HDD and Virtual Machine

    I am wondering if anyone else has had experience with attempting to recognize a 500gb Western Digital MyBook HDD in either VirtualBox or VMWare.

    I have been trying to get my ubuntu guest OS to see the drive for 2 hours or so and I can't get it to work. Not even an error or anything. I know these drives are notorious for being a pain so I think it may actually be the drive.

    Weird part is, it has to be plugged into a specific USB port in the back of my machine to work in Windows XP. It won't work in the front two ports which is kind of strange. I believe that this external drive is just bricked.

  • Microsoft's fancy footwork

    A couple of days ago Phil made this posting stating that he is going to Seattle to join Microsoft. He mentioned that one of the projects he will be working on is the new ASP.Net MVC framework. I won't be discussing my thoughts on the MVC framework here, but rather I will be discussing how this relates to the community which I had a very interesting conversation last night with my boss and a co-worker mainly about Apple but it also relates to the development community.

    Okay, first of all we can all agree that Microsoft has severely messed up on their implementation and deployment of Windows Vista. Joe Ocampo had a posting describing just this on LosTechies recently. I won't dive down into detail stating what they messed up on, but from 6 versions of an OS to severely over estimating the market I think it's pretty obvious that they screwed the pouch on this one.

    Apple is obviously the talk of the town at the moment with their iPhone, new iTouch, new iMacs and various other innovations. All of this without yet releasing their new OS, which by the way is coming soon. They aren't trying to massively hype everyone on Leopard which honestly they shouldn't be. I don't think it has that many new features to really hype up that much. Time Machine is cool, so is some new eye candy and various other application improvements but that's about it. The point here is, with Microsoft's recent Vista debacle, Apple obviously sees an opportunity to take some massive ground on the market and they should be taking even more advantage of soon. They may not be doing this with the iPhone but seeing how well these phones are doing it will definitely turn people's heads and get them thinking about Apple more and in turn get people to buy more Apple products.

    Linux is also doing quite well specifically with Ubuntu. They have now made it so easy to get up and running with Ubuntu that virtually anyone can do it. Along with the extremely strong community behind them, this is also going to taking some of the market. Perhaps not as much as Apple, but their fair share.

    Does any of this "market share" really matter at this point? Not really, I mean Microsoft is worth something like $270 billion at the moment while Apple is at around $50 billion. Immediately, this is no big deal to Microsoft, now 5 years down the road is a different story though.

    This brings me to my main point...

    The hiring of Open Source gurus and Alpha Geeks by Microsoft lately is quite interesting. What is happening now is that it seems like Microsoft has realized that they have screwed up with Vista and couple that with the fact that all the experienced developers are moving away from ASP.Net tools and going to open source ones like NHibernate, Castle, Spring etc.. they have realized that they have to do something quickly to save their eroding developer market. This is where the recent hires come into play like Scott Hanselman, Phil Haack and Rob Conery among many others.

    Now, I don't want to make it seem like I am downplaying the reasons these developers got hired for a hidden agenda at Microsoft because I am not. The reason that Microsoft hired them is because they are the best of the best AND because they have a very loyal following in the open source arena. Microsoft knows that the open source community will listen to all of these individuals and came to the conclusion of why bother trying to battle open source? Let's hire the best open source .Net developers and then this will bring the open source developers/alpha geeks back to Microsoft.

    In my honest opinion, this was an extremely smart move on Microsoft's part. After hearing about this I was excited to see this MVC framework from Microsoft. This coming from a person who refuses to even touch the painful ASP.Net Page Lifecycle among other gripes.

    Microsoft has definitely played this one very well, at least compared to how Vista turned out. That's why they are the most powerful software company in the world. They have realized that this was the best thing they can do at this time in the developer market. Invite the best of the open source community inside with open arms and try to understand how the rest of the community would like their software and frameworks to be built.

    Now, the final and biggest question... Will Microsoft now try to get these developers to do programming their way, or will these developers induce a very good, and needed change in how Microsoft develops their tools.

    I want to congratulate all of these individuals that Microsoft has brought on board. I am very jealous and hope to learn as much as I can from you so that I can hope to be as good of a developer as you gentlemen are!

    Cheers!

  • Blogging at LosTechies

    Jason Meridth contacted me a couple of days ago inviting me to cross-post my blog posts on LosTechies. I was very flattered to learn that anyone even read my blog posts let alone invite me to blog on their community site. He explained to me that the aim of the site was to create a very relaxed community around informative programming information that everyone would find useful. From an initial e-mail conversation I had with everyone I can already tell that this will be a lot of fun. Everyone I spoke with seems very pleasant and knowledgeable so I think it will be good to mingle with like minded people as well as learn some new things.

    As some of you may know I have a blog at WordPress that you can find here. In the beginning I am going to be cross posting to both blogs and see how that works out. Eventually I may move the whole blog to LosTechies. I do enjoy all the themes that wordpress has available. So that is a nice feature, but that's about it.

    I will mainly be blogging about The Castle Project (mainly MonoRail and sometimes Windsor), NHibernate, DDD (or my limited knowledge of it), TDD, and soon BDD as well as other various development topics.

    One of the first things I will be planning to do is setup a BDD Starter Series. I have been meaning to do is learn more about BDD as I have not had anytime to get started with it. I am a complete newbie when it comes to this. I think this would perhaps be a good series so everyone could walk down the same path and hopefully get something out of it with me.

    In closing I would like to thank Jason and everyone else at LosTechies for inviting me to blog here and look forward to spreading as much knowledge as possible as well as learn more in return.

    Cheers!

Copyright Los Techies 2007. All rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems