13 May 2011

ASP.NET MVC: A Journey

Hello, Gentle Readers.

I'm going to try something new: a journey on which you're allowed to ride along- and encouraged to back-seat drive.

As a developer, it pays to keep my skills up-to-date; this is something my current support posting makes more difficult than it might otherwise be. So, I decided that I should add some actual web development to my repertoire, and share the journey with you.

I'll be using ASP.NET MVC3, with its Code First abilities, to design a very light-weight, overly simplified Issue Tracking system. This is enough of a departure from the MV3 Tutorials that exist through Microsoft's site to show that I actually understand what I'm doing, and close enough to what they've done that I can crib from their notes when necessary.

I'll be hosting the project (as I build it) on CodePlex as MvcIssueTrackerDemo.codeplex.com. Go there for the latest code, and feel free to post recommendations/bugs/comments both at CodePlex and here in my comments.

Now, the best journeys begin with some idea of the destination, and the most successful have some idea of the stops along the way. So, to do our best to ensure a successful demonstration, we'll take the time to define what we're doing.

The Destination: A functional, if overly simplified and not-at-all secure Issue Tracker. It should be able to accept new issues, close issues, add work logs, and provide user maintenance and some basic statistics.
So, first, we'll design the Entity model, then we'll go about tackling each of the Entities to get them to behave like we expect.

The expected steps:
  1. Object Model
  2. Set up the Project
  3. Define the Models in code
  4. Create both Controllers and Views for each model- one at a time
  5. Prove it works
  6. Over view of the process.
So, in this, the first post, it only makes sense to discuss the object model.

I see the three following "entities" and one enum: Issues, Work Notes, and Users round out our entities, and we'll add a Role enum to enable some role-based security along the way.

Our Issue Object will include:
  • IssueId
  • Title
  • Detailed Description (I'll just call it 'Description')
  • CreatedBy (the User Id of the user who logged the issue)
  • CreatedDate
  • AssignedTo (the User Id of the user to whom the issue is assigned)
  • LastActivity (a DateTime)
  • ClosedBy (the User Id of the user who closed the issue)
  • ClosedDate
  • A virtual User for the Assigned User
  • A virtual ICollection<WorkNote> for the work logs.
Our WorkNote object will be very simple:
  • WorkNoteId
  • Details
  • UserId
  • DateTimeStamp
Users will have:
  • UserId
  • UserName
  • LastName
  • FirstName
  • Location (A vague term- I'll probably use it a Cube/Office number or something)
  • Password (In a real application, this would be a password salt and hash)
  • Role
  • A virtual ICollection<Issue> for the issues assigned to the User.

In the next post, we'll go through setting up the project, and defining the models.

No comments:

Post a Comment