I have just setup my brothers new website for his company Lucid Concepts.

He is a 3d/CGI/Illustrator/Artist and is available to do any work - his stuff is awsome!

The website is just up and he will be adding all of his portfolio and current news and work over the next couple of days so check it out.

Website: www.lucid-concepts.com

Email: mrhappy (at) lucid-concepts.com

I love this one, reminds me of Ninja Scroll Manga movie http://www.lucid-concepts.com/post/portfolio-the-pilgrim.aspx

The Ninja


Getting started – Project Structure

I have a standard project structure that I work to on 90% of all MVC.net web applications that I develop and would like to give some insight to what each part of the application

Folder Structure

The image below is the file system folder structure of this project.

  • Build
    Contains the build scripts for the CI server
     
  • Lib
    Contains all of the third party assemblies that will be used in this application.
     
  • Licenses
    Contains all of the third party assembly licences.
     
  • Src
    Contains the source code and project files.
     
  • Tools
    Contains the tools required for building and testing the application such as Nant and Nunit.

 

Visual Studio Solution

The image on the right is of my Visual Studio solution explorer which contains the following projects:

  • Build
    I create a Solution Folder and attach the build script files for easy access to edit within visual studio.
     
  • Core
    Initially when I create a new project, I keep all of my application and domain code in a core project separating the layers by namespaces as I personally do not see the need to overly complicate a project structure until such time as the codebase grows large enough to justify separating out to codebase into individual projects.
     
  • Core.Specifications
    Core.Specifications is referenced by Core.Specifications.Integration and Core.Specifications.State.  Core.Specifications is where I keep all of my test setup/helper classes.
     
  • Core.Specifications.Integration
    When it comes to testing an application, I prefer to separate out my integration and state based tests into separate projects.  It enables me to easily differentiate between the slower integration tests and fast state based tests when setting up my continuous integration server.

    The integration tests are those which actually execute against databases or other live services.
     
  • Core.Specifications.State
    The state based tests are those which are only testing the current “state” of the class under test.  For example when I add a Page to a Section, I want to assert that the page has actually been added to the sections page collection.
     
  • UI
    The UI project is the presentation layer of the application.  Harnessing the MVC framework and the Spark view engine give so much more freedom than the ASP.net Web Forms model.  It also has major benefits over the default MVC.net view engine, such as the formatting of the views – no classic asp spaghetti code in sight!
     

Next post will be on configuring the projects prerequisites - setting up castle/nhibernate/test helper libraries/MVC/Spark etc etc...

The Ninja

p.s the next post will be up when I return from Hong Kong (January)


The official count down has begun!

17 Dec 2008 In: General

Only 4 days left until I am in Hong Kong!  I really can not wait to get over there for Xmas and New Years and see my fiance again, shes been over there since August this year.

I am sure to have lots of blog posts about it including photographs from my (mis)adventures!

The Ninja

 



In this article we will look at the key elements of a CMS, what they do, and decide on what functionality is going to be delivered in the first iteration of the application.
 

Key Elements

At the core of any CMS there are four types of element – Sections, Pages, Content and Media.  The purpose of a CMS is to allow the user to manage and deliver their content in an easy, structured format.
 

Section

Sections are used to categorise pages into logical areas and to provide primary and secondary navigational structures. For example “Events” and “News” could both be classed as sections as they are logical locations for a visitor of the site to access news and event pages.
 

Page

Pages are containers for content; they are the main element of delivery used to layout and display content to the visitor. For example on an “About Us” page, the page element would be used to display some form of text and image based content with information relating to the website and who runs it.
 

Content<T>

Content elements are, in my opinion, containers for information.  These elements are actually what hold the text and image/file references that the user enters into the CMS.
 
A page may have multiple content elements contained within it, allowing a more finely grained customisation of how the delivery mechanism of the CMS works. For example, a page could contain 3 different content elements (text, photo gallery, text) in an order the user can decide.
 

Media

Media elements are things like PDF files, images, audio files, Word documents etc.  They should be stored in a logical way so that they can be accessed and used anywhere within the site via the CMS administration.  For example the company’s logo; the user should only need upload once and be able to use it on any page of the website without having to re-upload.
 

Iteration 1 Functionality

In the first iteration of this application I want to deliver a very basic working CMS that will allow the creation of top level sections with child pages and textual content (including the ability to insert images).
 
This way I should be able to get the core concepts and development decisions that I go through when building an application like this, and also enable me to deliver this how to series in smaller manageable chunks of information, code samples and screen casts.
 
Ninja
 
 

I have been planning on doing an open source CMS application for .net MVC platform for quite some time now, and with all of the recent activity on twitter and blogs its time that I actually get this project up and running.


What is a CMS?

“A content management system (CMS) is a computer application used to create, edit, manage, and publish content in a consistently organized fashion.[1] CMSs are frequently used for storing, controlling, versioning, and publishing industry-specific documentation such as news articles, operators' manuals, technical manuals, sales guides, and marketing brochures. The content managed may include computer files, image media, audio files, video files, electronic documents, and Web content.” - http://en.wikipedia.org/wiki/Content_management_system


Background

I have been using and writing CMS engines for many years now, working with everything from small in-house ASP.net CMS applications to massive “enterprise” CMS solutions such as IXOS Obtree C4.
 
There has not been a single CMS application that I have used where I could truthfully state that it was easily usable and rock solid – they each have flaws and drawbacks whether it’s in the code or in the GUI - I believe this can all change with MVC.net*
 
* I know MVC is not specifically for Microsoft Platform, I am writing from the point of view that developing this, or any, web application on the .net platform can be done in such a nicer and more scalable way than Web Forms.  This is not a debate on MVC.net vs Rails!!
 

Technologies

The key technologies that this application will be harnessing are:
  • MVC.net / MVC Contrib
  • Spark View Engine
  • NHibernate
  • Castle Windsor
  • Binsor
  • Boo
  • Rhino Tools
 

End Goal

My intention with this and future blog articles is to give an almost step by step in my thought process behind building a CMS application, code for each part of the application and (time pending) do some screen casts while writing code resulting in a final release of an open source CMS system for the development community to use.
 
Ninja
 

 


HORN Build Server - Thank you Team City!

11 Dec 2008 In: C# 3.5, HORN, ALT.net, ScotAlt.net

The wonderful chaps at Jetbrains have just sent me out a full Enterprise OSS licence for Team City build server.

I would like to say a massive thank you to Jetbrains from all of us at the Horn development team for supporting our project.

Long live Jetbrains!!

Ninja

 

 

 

 

 



Classic Taijiquan Push hands videos

5 Dec 2008 In: Kung Fu, Taiji

Here are some classic taiji push hands videos performed by the late Grandmaster Huang Sheng Shyan.

 

 

 

 


Taijiquan grading last night

3 Dec 2008 In: Kung Fu, Taiji

Last night’s grading was, well, interesting to say the least!Started off being graded on the Taiji Yang Family short form (which is anything but short), then the Taiji Bagua Circle, then Da Lu 1 and finally the Taiji broad sword form.

I had a few hairy moments throughout the night, forgetting some connecting moves but eventually remembered them during pre-grading practice.

I have been told by Si Fu that from a martial (combat/fighting) perspective, I am already at black belt level.  What‘s holding me back from getting my black belt is my knowledge of the acupuncture meridians, and the delivery of my form’s.

However, last night I passed my grading, and have actually skipped a belt to go from purple to brown belt 1st tab – 2 more tabs on brown and I will have my black belt.

I am really happy about this as I feel that I am actually making great progress now.

Having been doing this art for 15 years now, about 5 years ago I handed my belts back in and started from scratch again through respect for the club as I had been out of training for over 2 years due to injury and being too occupied with work.

Onwards and upwards now!

The Ninja

 


IEnumerable of T to SelectList extension methods

2 Dec 2008 In: C# 3.5, MVC.net

 Here are some helper extension methods I use within MVC.net to convert IEnumerable lists of T into SelectList's for use on form Dropdown lists.

Code:

    public static class ListExtensions
    {
        public static IEnumerable<T> ForEach<T>(this IEnumerable<T> collection, Action<T> action)
        {
            foreach (var item in collection) action(item);
            return collection;
        }

        public static SelectList ToSelectList<T>(this IEnumerable<T> collection)
        {
            return new SelectList(collection, "Key", "Value");
        }

        public static SelectList ToSelectList<T>(this IEnumerable<T> collection, string selectedValue)
        {
            return new SelectList(collection, "Key", "Value", selectedValue);
        }

        public static SelectList ToSelectList<T>(this IEnumerable<T> collection, string dataValueField, string dataTextField)
        {
            return new SelectList(collection, dataValueField, dataTextField);
        }

        public static SelectList ToSelectList<T>(this IEnumerable<T> collection, string dataValueField, string dataTextField, string selectedValue)
        {
            return new SelectList(collection, dataValueField, dataTextField, selectedValue);
        }
    }

Usage:

ViewData["Countries"] = Country.AsList.ToSelectList("Code", "Name", "GB");

Cheers

The Ninja


The Ninja blog has arrived!

2 Dec 2008 In: General

I have finally got round to setting up my blog.  It has been a long time coming and the only thing that was holding me back was the lack of code formatting within the blog engines out there but thanks to “The Wookie” this has now been resolved.

So what can you expect to find in here? You can expect to find articles on programming, my daily life and kung fu – and that’s about it!

Up and coming articles:

Cheers

The Ninja


About this blog

Dave the Ninja is an Alt.net practitioner from Glasgow in Scotland (UK). He rants about all things from coding to Kung Fu with some swearing thrown in for good measure.

Dave the Ninja has been programming professionally with Microsoft technologies for the past 9 years starting and is now working primarily with C# 3.5, MVC.net and Resharper.

Dave the Ninja has been practicing Chinese internal arts for the past 15 and a half years, mainly Taiji Quan, Neijia Quan , Chi Na and Qigong.

I have joined Anti-IF Campaign

My Communities/Projects

Flickr PhotoStream


Sponsors