24, "open source" EFW framework WinForm Front-end development of project structure description and debugging methods

Source: Internet
Author: User

Back to the "open source" EFW Framework Series article index

EFW Framework Source code Download V1.2:http://pan.baidu.com/s/1hcnua

EFW Framework Instance source code download: Http://pan.baidu.com/s/1o6MAKCa

Preface : The previous chapters explain the development of a web system of the complete directory structure and interface development Framework Jqueryeasyui, the next few chapters on the development of WinForm system complete directory structure and interface development of the relevant controls. The development WinForm system is divided into two types, C/s mode and C/S/S mode, in which the middle layer of C/S/S mode uses WCF as middleware in EFW framework;

This article highlights:

1. Common three types of system description

2.Winform system directory Structure overall description

The directory structure and debugging method of 3.C/S system

The directory structure and debugging method of 4.C/S/S system

1. Common three types of system description:

1) c/s also known as client/server or client/server mode. Servers typically employ high-performance PCs, workstations, or minicomputer, and employ large database systems such as Oracle or SQL Server. The client needs to install the dedicated client software.

2) b/S is brower/server abbreviation, the client computer installs only one browser (Browser), such as Firefox or IE, the server installs the database such as Oracle or SQL Server. The browser interacts with the database through the Web Server.

3) C/S/S is a three-tier architecture, which is a "middle tier", also called "Middleware", which includes the business logic layer and the data access layer between the C/S client and the database, with Wcfcontroller, ObjectModel, Dao and Entity;

Three types in the program can be implemented in accordance with the three-layer structure, the program three layers in different environments to form the above three types, such as: C/S Type is the program three layers are running on the client, and the C/S/S type interface layer run on the client, And the other logic layer and data access layer are running on the middleware server;

The advantages of three-layer program structure, more applicable to the increasing complexity and flexibility of enterprise systems, layered design follows high cohesion, low coupling principle, to achieve the requirements of expansion, maintenance and reuse, can greatly improve the development efficiency.

2.Winform System directory structure Description

such as the directory structure of the WinForm system, the difference between the two types is that the C/S/S solution has more than one WCF Service host program, the others are similar, the configuration files are in the Config directory, Interface layer code in the Books.winform project, the logic layer code in the books project, can say two types of common interface code and logic code, only on the controller on the former with Wincontroller, after the Wcfcontroller;wcfcontroller controller is divided into two code file b OokwcfclientController.cs and BookWcfController.cs are placed in Books.winform projects and books projects; two files re-run the communication through the WCF service; Although both types write code in one solution, The installation and deployment of the program is also different, C/s type all the code is running on the client, while the C/S/S type Books.winform project runs on the client, and the books project runs on the WCF Service host, the WCF Service host is deployed on the server;

3.c/s Type WinForm system project structure and debugging method

1), EFWWin.exe: Client startup program    

Description: The login, main interface, and basic functionality in the framework are encapsulated in this program

Dependencies: None

2), Books.winform: interface layer

Description: 1. The interface files are placed in this project

Dependencies: Efwcorelib, Devcomponents.dotnetbar2, Books

3), Books: Logic Layer

Description: 1. The logic layer code is placed in this project, including controller, ObjectModel, DAO, and entity

Dependencies: Efwcorelib, Enterprise Library EntLib

How to debug a program :

For example, we use the debugging method to make clear the process of displaying the data in the interface table. Set Efwwin as the startup program, F5 run the program, login into the main interface, click the menu to open the Interface Table control display book data by default, in the traditional practice is in the interface code in the constructor or Frm_load () event to write code to load the data. The use of the controller in the EFW framework is not the same, the entry of the program is not started from the above two ways, but from the controller rewrite of the init () method entered, call the method of obtaining data Getbooks (), call Bookdao fetch DataTable data, The data is then displayed on the table control that is bound to the interface by the interface;

4.c/s/s type WCF system project structure and debugging methods

1), EFWWin.exe: Client startup program    

Description: The login, main interface, and basic functionality in the framework are encapsulated in this program

Dependencies: None

2), WCF Service host. EXE:WCF Middleware Startup program

Description: WCF host program, logical layer project run in this program

Dependencies: None

3), Books.winform: interface layer

Description: 1. Interface files are placed in this project 2.WCF project and Wcfclientcontroller code file

Dependencies: Efwcorelib, Devcomponents.dotnetbar2, Books

4), Books: Logic Layer

Description: 1. The logic layer code is placed in this project, including controller, ObjectModel, DAO, and entity

Dependencies: Efwcorelib, Enterprise Library EntLib

Program Debugging Methods:

For example, debugging a WCF program requires starting two programs Efwwin and wcfhosting, starting wcfhosting in VS, clicking Start WCF Service, Then in the Out directory double-click Run EFWWin.exe program, then log into the main interface click the menu to open the interface, breakpoints into the Bookwcfclientcontroller init (), and then through the Getbooks () method to the WCF middleware to send the request, The breakpoint enters Getbooks () in Bookwcfcontroller, calls Bookdao to fetch the DataTable data, and then goes back to Bookwcfclientcontroller from the JSON data, Deserializes the JSON back into a DataTable displayed on a tabular control;

24, "open source" EFW framework WinForm Front-end development of project structure description and debugging methods

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.