Friday, August 6, 2010

Relieve Endometriosis Bloating

project and the basic structure of helpers and extensions.

In this post I will try to bring home the project structure as well as to describe the basic helpers and extensions that I use most of my projects.


Project Structure: - mForum.Core
- Here you will find all the class / structure / methods that are common to the entire walkthrough and be used in each project.
- -
mForum.Infrasturcture.Automapper
- This project will need to initialize the class library AutoMapper - mForum.Infrastructure.NHibernate
- Here znowuż find everything related to the mapping data and base. So implementations of repositories, objects, initiating database. - mForum.Services
- This is an intermediary layer between business logic and presentation layer which is Asp.net MVC in this project. You will find here mostly all the classes, methods that are mediated the circulation of data between the business logic layer and presentation layer. - mForum.Web
- Here we have the presentation layer. In this project we will find views, scripts, js, css templates. In general, everything related to web design from the graphic. - mForum.Web.Common
- This is a project in which objects are directly related to the presentation layer from the developer. Here, we will be able to find their own attributes, MVC controllers, the tasks to be performed just prior to application (called Bootstrapper Taski). As I mentioned earlier have already added the class / method that I usually use in each project, such universal support class work.
The first of these is a class check. This class has methods sprawdzajace The input data and in case the condition of inconsistency in the method throws an appropriate exception. A simple example of checking whether the inputs are not null: testMethod void (object testProperty)
{if (testProperty == null) throw new ArgumentException (testProperty can not be null ");
... }
In the case of a single argument that is not too onerous and in larger quantities can cause a slight accumulation of conditional statements. This is solved by the same class Check:

testMethod void (object testProperty)
{
 Check.Argument.IsNotNull (testProperty, "testProperty"); 
...
}

Check class has many more methods for validation of input data. Once more I invite you to familiarize yourself with the code.

addition, I added a couple of extension methods for classes:
-
 DateTime: a method of verifying the correctness of the dates. Check class directly using these methods. 
-
String
: methods such as validation of the string as a url or e-mail address. Check the class uses them.
-
IEnumerable
: I added the extension that allows you to execute a line of code iterates through all elements of the collection and enforcement of any action on them. Foreach loop in condensed form.

That's it for today. Here comes the weekend so you can probably expect more entries. Oh and one more thing I have published a project on CodePlex so now everyone will have access to it. It is true that much still there but hey:)

0 comments:

Post a Comment