Vlad's blog

In programming veritas

Archive for December 2011

Task Manager: application architecture and domain model

with 5 comments

This is the second post of a series of posts on developing Web applications using ASP.Net MVC. The previous post is available here. The source code is available on CodePlex.

Application architecture

The system has the following layers:

  • Presentation layer
  • Domain layer
  • Data Access layer
  • ORM
  • Database layer

The last two layers (ORM and Database) are more likely to complete the picture, because they have already been implemented by the Entity Framework.


Read the rest of this entry »

Written by vsukhachev

December 29, 2011 at 11:17 am

Posted in Development, Uncategorized

Tagged with ,

Task Manager

leave a comment »

The best way to learn a new framework is to build something with it. I am going to write a series of posts on how to develop Web applications using ASP.Net MVC, and a number of related technologies and libraries:

  • Entity Framework Code First
  • Autofac
  • Automapper
  • Rhino Mocks

The source code is available on CodePlex. The following posts are available at the moment.

In addition to questions related to the use of mentioned technologies will be discussed principles of DDD in designing application architecture, as well as writing unit tests for components of the system.
Task Manager is a small, but a complete application for managing tasks and projects. The user can create a new project or add tasks in the current project.

In order to create new task you must select project from the list of available projects and choose an assignee.

Each user can view a list of your active tasks, as well as a list of all tasks and a list of completed tasks.

Every task has a log.

Users can add their comments to the task.

Written by vsukhachev

December 28, 2011 at 8:18 am

Posted in Development

Tagged with ,

Ext JS – modern framework for creating RIA

leave a comment »

Modern web application has long ceased to be a set of HTML pages, when interaction is reduced to a simple processing on the server. The growing popularity of RIA requires an infrastructure that allows to program complex logic on the client. In connection with this trend towards the creation of JavaScript frameworks that provide a framework for application design in accordance with such well-known patterns like MVC and MVVM.
Ext JS is one of the popular frameworks for building Web applications that look and behave like traditional desktop application. Typically, such an application is a single HTML page container that contains a hierarchy of widgets. A server role is reduced to the processing of AJAX requests and implement the business logic that can be realized only on the server.
To illustrate the above, consider an example using Ext JS. Suppose we are developing a project management application. The basic application abstraction is a task that has the following attributes.

  • Project which is a container of task
  • Description
  • Status (Not Started,In Progress,Closed)
  • Estimation (man hours)
  • Progress (percentage of completion)

Read the rest of this entry »

Written by vsukhachev

December 16, 2011 at 5:14 am

Posted in Development

Tagged with

C++0x: rvalue expressions and move constructor

leave a comment »

I continue to write about the language features that were added to the new standard C++ 0x. This time we discuss how we can reduce the number of copy operations using move semantics for copy constructor, which is used for rvalue expressions.
But before we talk about the move constructor let’s discuss lvalue and rvalue expressions.
Every C++ expression is either an lvalue or an rvalue. lvalue expression is an object that has a name. All variables are lvalue. rvalue is a temporary object that does not exist outside of the expression that created it. In the following example a is an lvalue, the result of the expression 2 + 2 – rvalue.

int a = 2+2;

Technically evaluating the expression 2+2 creates a temporary object that is then copied into a variable a . For built-in types, this will not be much cost in terms of performance. For user-defined types, which are demanding the copy operation, the costs associated with calling the copy constructor can be substantial.
In the following example string str1 is assigned the result of concatenating the string str2 and str3.

std::string str1;
std::string str2("Hello");
std::string str3(",World!");
str1 = str2 + str3;

As a result of the addition a temporary object is created that contains the string “Hello, World!”. Then assignment operator is called for str1 that copies the contents of the temporary object in str1. After that, the destructor is called for deleting of the temporary object.
What happens if instead of copying the temporary object we use move semantics? The temporary object is still deleted and will not be used anywhere, so its data (a pointer to a string, for example) you can simply assign the appropriate field of the object str1 without calling an expensive copy operation.But this method is only valid for rvalue expressions. Hence, we need some way to distinguish when the assignment operator is called with the lvalue expression, and when to rvalue.
Read the rest of this entry »

Written by vsukhachev

December 9, 2011 at 2:47 am

Posted in Development

Tagged with