Learning MVC 2, Workflow Foundation 4, and maybe Silverlight 3, Part II

In my previous post, I mentioned designing a small database to support a learning application I'd like to write. I also mentioned I'd discern the differences in the two workflow persistence models I see that are available in Workflow Foundation 4. Let's start with the latter.

It turns out there isn't really much to say. WF 3.5 persisted workflows using a "persistence provider model." WF 4, on the other hand, uses persistence according to an "instance store." The two models are incompatible, and the persistence provider is shipped with WF 4 only for backwards compatibility. All new WF 4 workflows should use the instance store, so mystery solved. We'll use the instance store when we get to that point.

As for the database, my goal isn't to design the be-all, end-all of databases for HR (as you may recall, the task will be to authorize vacation/holiday time off, which is an HR function). I just need some basic information:

  • The empoloyee's name, both requestor and manager
  • E-mail addresses
  • Amount of remaining vacation
  • An employee ID, used to uniquely identify everyone in the database

For my sample application, this data should suffice. There is always more we could add, like amount of vacation authorized by the manager but not yet taken, or the amount of vacation rolled over from last year--that sort of thing. For my needs here, however, I'll keep it simple. I'm much more interested in the workflow for vacation authorization and connecting that to an MVC application.

With that information in mind, I created this database scheme:

It's somewhat normalized, but I tend to design database that way. I say "somewhat" because the RemainingVacation column is stuck in the EmployeeData table, which isn't really where I'd probably put it in a true HR database design, but it's better than adding a third table just for this little sample application. So I'll live with that bit of denormalization. Smile I created some test data, which you see in this script (I'll swap out the e-mail addresses for valid ones later):

INSERT INTO [Koozkooz].[dbo].[Employees]
           ([EmployeeID])
     VALUES
           ('5001')
GO

INSERT INTO [Koozkooz].[dbo].[Employees]
           ([EmployeeID])
     VALUES
           ('10001')
GO

INSERT INTO [Koozkooz].[dbo].[EmployeeData]
           ([EmployeeDataID]
           ,[EmployeeID]
           ,[FName]
           ,[LName]
           ,[EMail]
           ,[RemainingVacation]
           ,[ManagerID])
     VALUES
           ('CEBB9D6F-9B50-4C8E-BAC7-B8E03377E5EB'
           ,'5001'
           ,'Tonya'
           ,'Manager'
           ,'tonya@koozkooz.com'
           ,20
           ,'0')
GO

INSERT INTO [Koozkooz].[dbo].[EmployeeData]
           ([EmployeeDataID]
           ,[EmployeeID]
           ,[FName]
           ,[LName]
           ,[EMail]
           ,[RemainingVacation]
           ,[ManagerID])
     VALUES
           ('A57152B2-D4F3-4A5E-8F74-C734C3B5C9A2'
           ,'10001'
           ,'Aimee'
           ,'Employee'
           ,'aimee@koozkooz.com'
           ,5
           ,'5001')
GO

The image depicting the database is from Visual Studio, and you've probably already noted I'm using LINQ to SQL. I've started framing the application in Visual Studio 2010 (Beta 2). I settled on the name "KoozKooz," if only because a quick Web search didn't turn up a lot of hits on the name:

Something in the beta I believe needs to be addressed is the ability to name things. When creating new projects, for example, you tell Visual Studio 2010 where you want the code located, but it names the project. At least the solution is named according to the location, as you'd expect. Anyway, in my case, I created an MVC 2 Web application, but Visual Studio named it "MvcApplication2" for me. I'll probably rename it to be "KoozKooz.Web," but you get the idea. Another limitation in the beta is deciding where Web apps should be hosted. With Visual Studio 2008, you can choose to use Cassini or IIS (locally or remotely). That functionality is not present in the current beta, but clearly it's needed. I'm sure it'll be in the next beta, or whatever release Microsoft intends.

In the next post, I'll start rigging up the data access and application layers, as well as their unit tests.

(Update: I found the KoozKooz domain was available, so I bought the rights. It's nice to be legal. Smile)


Tags: , ,
Categories: .NET General | ASP.NET | Workflow

2 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Comments

December 6. 2009 00:29

trackback

Learning MVC 2, Workflow Foundation 4, and maybe Silverlight 3, Part III

Learning MVC 2, Workflow Foundation 4, and maybe Silverlight 3, Part III

Kenn Scribner

April 22. 2010 13:23

Alcohol Rehabilitation

you put the all great things which makes all people getting interested. but yes thats right, i agree. all you mention is make a sense. Thanks
Best artickle, I seek for the artickle like this. Nice to read. Thanks for your great information. My best regards.

Alcohol Rehabilitation

Add comment




  Country flag

Click to change captcha
biuquote
  • Comment
  • Preview
Loading