Last time we completed the interface and implementation of the data access layer, this time we step by step to complete the business layer interface and implementation, and the use of Spring.net declarative transactions. In addition, the NUnit is used to unit test the business implementation.
Like the PetShop framework, we first define the business layer interface, which only has a coupling with the entity. Let's take user users for example:
Iusermanager
Using Directcenter.model;
Namespace DIRECTCENTER.IBLL
{
<summary>
User Management
</summary>
public interface Iusermanager
{
<summary>
Create a user (return contains default values)
</summary>
<returns></returns>
User NewUser ();
<summary>
Save user
</summary>
<param name= "user" > Entity </param>
<returns></returns>
User saveuser (user user);
<summary>
Get user
</summary>
<param name= "userId" > User id</param>
<returns></returns>
User GetUser (string userId);
<summary>
Delete User
</summary>
<param name= "userId" > User id</param>
<returns></returns>
void DeleteUser (string userId);
<summary>
Updating users
</summary>
<param name= "user" > Entity </param>
<returns></returns>
User UpdateUser (user user);
}
}