This system article will elaborate the client application design concept, the realization method.
This series of articles is designed and implemented on the basis of the Sailingease WinForm Framework, but the design concepts and methodologies also apply to the design and development of any type of client application.
Directory:
Http://www.cnblogs.com/sheng_chao/p/6084144.html
Objective:
may be contact with the computer earlier, starting from around 96 to 386, to Trubo C, and later the FoxPro, VB, Delphi, has always seemed to have a client program plot, like to write client program.
After the advent of. NET, a lot of time has been devoted to the study of. NET programming, in the early years of the client domain, WinForm mainly in the field, and gradually turned to WPF.
In addition to the daily work of the project development, spare time to use WinForm wrote a lot of things, compared to the molding of about two
1) sailingease WinForm Designer IDE (2007~2010 pause development)
http://www.cnblogs.com/sheng_chao/p/4387249.html
The highly implemented IDE development environment, complete with WinForm Designer, defines the interface and business logic through a visual configuration method, and describes it using XML.
The project starts with a big heart, trying to be a person who doesn't know how to program, and can drag and drop drawing plus configuration to build the management software needed by the enterprise. Spent about two years of spare time, this period should be my own development capacity and design ability to increase the fastest time, start to do this project, there are too many problems beyond the scope of ability, had to look everywhere to find books to read, to find information learning. On the way home every day after reading the "design mode", the usual debris time read the "Code Daquan 2", in addition to read the sharpdevelop of many source code, but also a part of the implementation is reference to its ideas and code.
2010 years or so due to limited time and energy, coupled with the software project has a number of new knowledge and ideas, the project has been suspended so far. Several other small-scale WinForm projects, and the protagonist of this series of articles: the Sailingease WinForm Framework, are derived from this project.
2) sailingease. NET Resources Tool
Http://www.cnblogs.com/sheng_chao/p/5958846.html
A utility designed to assist multi-language software development by generating interfaces to constrain the implementation of different language resources, enabling developers to invoke resources based on interfaces. In addition, it provides a variety of useful functions for developers to use, such as multi-project parallel editing, resource import, Excel import, export and so on.
This project is based on the IDE project above, because the IDE is too big to be able to support multiple languages, but slowly found from the engineering point of view, this is a very troublesome, easy to control things. Just spend time, think of a way to use interfaces to constrain different resources.
Finally, the protagonist of this series of articles: Sailingease WinForm Framework.
In fact, this is a pure development framework extracted from the IDE project, which has no ready-made functions such as user management and rights management, but rather a development framework that provides a purely development perspective, providing the following features in a nutshell:
A. Host program (shell) and function module (plug-in) loading, scheduling, communication and other implementation;
B. The implementation of mechanisms such as synchronous/asynchronous invocation, state response, and so on, on the basis of complete coupling between different plug-ins;
C. There is no cross-referencing relationship between plugins at the code level, enabling applications to be launched without any plug-ins, even if they intersect at the UI level;
D. Support for the definition of dependencies between modules;
D. event aggregator for publishing and subscribing to events under fully decoupled conditions;
D. Host program provides a unified main menu and the right-click menu Registration/revocation/state control mechanism;
E. The host program provides a unified window scheduling/loading/destroying function;
F. The host program provides unified logging, exception capture, Web page interoperability and other functions;
G. A control package based on GDI +, which provides a high degree of scalability;
H. zip-based Package Manager (a zip-based custom file format that reads or writes to a specified stream);
I. Enhancement and encapsulation of HTTP, XML, disk IO, reflection, encryption and decryption operations;
J. Other ...
Chapter One: Overview of client software architecture design
This section outlines the architectural design of client applications that are based on the Sailingease Winform framework framework.
Often a friend or client will ask, "You this software is not a three-tier architecture design."
In fact, the client software architecture is not so divided design, and far more complex than the so-called three-tier architecture, and the WEB program in different pages between the stateless jump, the client program more as a whole, single page WEB application has some aspects similar, but there are many differences.
We'll get an overview of the client program architecture based on the Sailingease Winform framework through a simple design diagram:
the core of the Sailingease WinForm Framework is modularity.
Applications based on the Sailingease WinForm Framework framework consist of loosely coupled modules that are dynamically loaded at runtime, which contain visual and non-visual components that represent the different functions of the system, and visual components (views) are grouped together in a single shell (the main window).
The host program provides a variety of basic services and combines these module-level components, and the module can provide additional services related to the specific functionality of the application.
The Sailingease Winform Framework is an implementation of the composite view design pattern that supports a view recursive structure that contains children. These subkeys themselves are views, which are combined (dynamically combined at run time rather than at design-time static combinations) by a mechanism.
Modules never directly reference each other or directly refer to the host. They use mechanisms such as services, event aggregation, and so on to communicate with each other and between hosts, and respond to user actions.
There are many advantages to using modules to compose a system. Modules can aggregate data from different back-end systems in the same application. In addition, the system can evolve more easily over time. When system requirements change and a new module needs to be added to the system, the modular system is much less conflicted than a non-modular system. You can also improve testability by making more independent improvements to existing modules.
Modules can be developed, tested, and maintained by different teams. When a small team develops a maintenance module, it does not have to load the entire application solution, just create a thin solution that includes the host and the specified module.
In the Sailingease Winform Framework, you can define dynamic dependencies between different modules, and sometimes a complete business operation requires collaboration between different modules, some of which are not required, and we can do this in the absence of some modules. Perform a full business process normally:
Active mode:
The active mode is implemented using the builder mode, which actively controls the process by the initiating module of the business or operation, and by itself determines whether the modules and modules that need to respond exist.
Passive mode:
The passive mode is implemented using the event aggregator, which sends a notification to the event aggregator when the initiating module of the business or operation completes itself, and the module registered in the event aggregator receives the appropriate notifications and data to respond to business operations, and the different modules of the response event aggregator can be processed concurrently using multithreading techniques.
In passive mode, the release module of an event does not care at all about which modules respond to events or the response results of events. For the module that responds to events, they don't care who publishes the event, just handle the business accordingly.
Dynamic dependency at the view level:
For example, when I select a user in the user List screen in the user information module, the bottom of the screen needs to display the user's most recent order, and this order information area (View) needs to be provided by the order module, but when the order module does not exist, or does not load, the user screen can still display and use, It just shows the location of the order information and is hidden.
When both the user module and the Order module are present:
When you select a user in the user list, the most recent order is automatically displayed below the screen.
It is obvious that the user module and the order module not only have the fusion of view level, but also the fusion of operation response, and these fusion and invocation are fully decoupled in the Sailingease Winform Framework, and there is no mutual referential relationship between the two modules.
When the order module does not exist or is not loaded, the screen in the user module is automatically adjusted and the UI action has no effect:
modularity is only the basis, in addition to modularity, as a host program, usually provides a series of basic performance.
Some of the most important: the main Menu/right-click menu/Toolbar fusion and Scheduling, window scheduler, thread Scheduler, service container, event aggregation, etc. I will elaborate on this in a follow-up article.
A typical application architecture based on the Sailingease Winform Framework
Take the Sailingease WinForm Designer IDE for example:
Run-time Effects:
in the next section, I'll elaborate on the architecture of the client application and detail how modular development based on the Sailingease Winform Framework is implemented.
Welcome to add me QQ Exchange discussion, joint study: 279060597, and I in Nanjing, have Nanjing friends?
Developing excellent client applications based on the Sailingease WinForm Framework (1: Overview)