Well-designed Component-Based C # win forms practices a framework database drives multiple business logic Databases

Source: Internet
Author: User
Tags sql server express

Design a flexible and stable multi-layer architectureProgramIt is not easy. With mature models and applications, you also need to experience various applications and requirements. To put it bluntly, you must be able to withstand the difficulties. Recently, when restructuring your EPN framework, I have some new experiences and practices to share with you.

The first is the database design. A framework database drives multiple business logic databases, which is already recommended by everyone.

The framework database framework contains the basic configuration of business data, which can drive the operation of one or more business databases.

Framework is a framework database that contains basic business rules, queries, menu components, permissions, and version management. This framework can drive the northwind database to implement the northwind trade program and emp51 to implement the ERP program.

When logging on to the client program, you need to select the database as northwind to log on to the northwind trade database. There are also some improvements in this area. You can change the database to company or system to a more professional system name, which will be explained later.

After entering the enterprise solution system, select Database Registration and bring up the following interface. You can see its implementation section.

All the secrets of the Framework database-driven business database are here. Connection parameter is the connection string parameter. It is configured to connect to the northwind database of the local SQL Server Express. The following grid shows the business logic and interfaces related to this database.

Module name Module name. For example, the ERP system includes the following modules: Engineering, sales, purchasing, and production planning.
Type The module type is. Here is the key setting point.
Iservice interface module, which defines functional interfaces
Service implementation to implement functions in the interface
A system must contain one interface module and multiple implementation modules.
Businesslogic business logic customized for the customer
The presentation layer is also the interface layer. Here we use winforms technology, which can also be replaced with WPF technology, or Silverlight, Asp. net web/MVC, because the interface layer is only responsible for binding data, the business logic has been completely separated into the businesslogic layer.
Path The Assembly corresponding to the module, usually a DLL assembly.

In this version of EPN framework, the Framework Program and business program are completely decoupled. For example, if you need to design a trade program based on the northwind database, its solution view is as follows:

This view is the one registered by the company above.CodeView, interface (iservice) and implementation (service), business logic (businesslogic), plus an interface layer administration to manage trade orders, customer exchanges. With this design method, the business logic and its implementation are completely separated to implement a general C #. Net win forms development framework.

This design also has some defects. For example, when the business logic is too scattered or completely different, the Framework database also needs to be adjusted. The adjustment here refers to the re-generation of the database content, without the need to change the code. For example, the query, report, menu, user preferences (personalize), functional permissions, and user permissions involved in the business logic are all stored in the framework database. When a new project is re-developed, you need to call the following system functions to regenerate the basic data to meet the requirements of the new system.

Functions and permissions

Menu Definition

You also need to reconfigure parameters for the report definition.

Start the query designer to redesign the query to meet the new business logic needs.

The last task is to re-tune the translation resources. You need to modify the translation according to your business needs. For example, styles can be translated into styles. in the garment industry system, they should be translated into styles.

After the data preparation, the new project is almost half done. The subsequent part is to complete various designs tailored to the customer's requirements to ensure that your project is delivered on time.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.