Realize the device that user interface separates with service logicTechnical field
The present invention relates to software architecture and realize technology, particularly relate to a kind of device that user interface separates with service logic of realizing in software development process.
Background technology
In Software Architecture Design, between subscriber interface module and business logic modules, there is inseparable contact.Due to the use habit difference at user to user interface, often can produce new demand to user interface, need often user interface to be changed.And business logic modules all has fixing pattern and flow process conventionally, can not change easily.Especially the present development along with software industry, the user of software wants the convenience of sum operation to have deeper requirement for the user interface sense organ of software, if coupling is too tight between subscriber interface module and business logic modules, in subscriber interface module amendment, also need business logic modules to make corresponding adjustment so.If amendment often, the code of software also can get more and more so, to such an extent as to has lost original structure to last software, cause nobody to safeguard.
Thus, can find out the details that realizes that must understand mutually the other side between existing subscriber interface module and business logic modules, will make the opposing party cannot true(-)running when a side has occurred to change; The high coupling of this structure makes the structural very poor of system, and extensibility is also very poor.
Summary of the invention
The present invention wants technical solution problem to be to provide a kind of device that user interface separates with service logic of realizing, it can reduce the degree of coupling of subscriber interface module and business logic modules in software development process, ensure development quality, improve dirigibility and the extendability of system.
For solving the problems of the technologies described above, of the present inventionly realize the device that user interface separates with service logic and comprise:
Subscriber interface module, realizes the interface pattern of user's needs and user's operation logic;
Business logic modules, for realizing the service logic part of actual software requirement;
Interface management module, be used for connecting subscriber interface module and business logic modules, data transmission and the behavior between subscriber interface module and business logic modules of realizing is synchronous, and interface and the synchronous interface of behavior that logarithm is reportedly passed manage, scheduling and interface upgrade;
Described subscriber interface module is realized for the synchronous service logic callback interface of behavior, and calls service logic interface; When subscriber interface module triggers certain event, when this event need to be called certain function of described business logic modules, subscriber interface module only needs the respective logic function in the service logic interface of calling interface administration module; In the time that this respective logic function completes, need to notify subscriber interface module, present a result to user; Subscriber interface module only need to be realized accordingly part at service logic callback interface and respond;
In the time that business logic modules need to adopt subscriber interface module to trigger the result after certain event, business logic modules only need to be called the corresponding function of service logic callback interface.
Owing to adopting the device that user interface separates with service logic of realizing of the present invention, utilize interface in software development process, the exploitation of the exploitation of subscriber interface module and business logic modules to be separated, realize concurrent development, therefore can not affect the quality of software self.In software development process, the frequent amendment of subscriber interface module or business logic modules can not have influence on the code execution of other parts.Make business logic modules can in different, tackle different subscriber interface modules, and needn't be concerned about specific implementation process and the method for business logic modules.Reduce the degree of coupling between business logic modules and the subscriber interface module in software development process, ensured development quality.The present invention has reduced the mistake producing due to the frequent amendment of subscriber interface module or business logic modules, has accelerated the speed of software development.
Brief description of the drawings
Below in conjunction with accompanying drawing and embodiment, the present invention is further detailed explanation:
Accompanying drawing is theory diagram of the present invention.
Embodiment
Core concept of the present invention is: subscriber interface module is separated with business logic modules.At software development phase, user interface present the implementation procedure that does not need to comprehend service logic, service logic does not need to understand the implementation method of user interface yet.Thereby reach user interface and service logic concurrent development, the effect of Speeding up development speed.
Shown in accompanying drawing, realize in device one embodiment that user interface separates with service logic of the present invention, comprise subscriber interface module, business logic modules and interface management module.
Described subscriber interface module, for realizing the interface pattern of user's needs and the operation logic that user uses; And realize and be arranged in interface management module for the synchronous service logic callback interface of behavior, and call service logic interface.
Described subscriber interface module comprises: the service logic callback interface in interface form module, interface management module is realized the service logic interface interchange module in module and interface management module.Described interface form module, for representing the interface pattern of user's needs and the operation logic that user uses.Described service logic callback interface is realized module, for realizing the response of the complete rear execution result to service logic of service logic.Described service logic interface interchange module, for setting up the function of service logic interface.
Described business logic modules, be used for realizing customer service logic flow, for example, for realizing the service logic part (: user log-in authentication system, flow process is as follows: user inputs user name password → click ACK button → verified users name password → authenticate → return to user authentication information) of actual software requirement; And realize the service logic interface that is arranged in interface management module, call service logic callback interface.
Described business logic modules comprises: service logic process module, the service logic callback interface calling module in service logic Interface realization module and interface management module in interface management module.Described service logic process module, for realizing user's operation flow.Described service logic Interface realization module, for realizing the set of function of the service logic interface calling for subscriber interface module.Described service logic callback interface calling module, for setting up the function of service logic callback interface.
Described interface management module, be used for connecting subscriber interface module and business logic modules, realize interface and the synchronous interface of behavior that data between subscriber interface module and business logic modules are transmitted, and interface and the synchronous interface of behavior that logarithm is reportedly passed manage, scheduling and interface upgrade.
Described interface management module comprises: service logic interface, service logic callback interface and interface manager.
Described interface manager comprises: interface enquiry module and interface acquisition module, whether described interface enquiry module, exist new interface for inquiring about.Described interface acquisition module, for obtaining the new interface needing.
Searching and managing is carried out in the interface variation that described interface management module is brought for interface upgrade, and the new interface inquiring is passed to and calls ISSUER.
When subscriber interface module triggers certain event, when this event need to be called certain function of described business logic modules, subscriber interface module only need service logic interface in calling interface administration module, in respective logic function.In the time that this respective logic function completes, need to notify subscriber interface module, to can show to some extent in subscriber interface module, need to present a result to user.For this reason, only need to the service logic callback interface in the interface management module having realized in subscriber interface module realize accordingly part and do corresponding displaying interface.In the time that business logic modules need to adopt subscriber interface module to trigger the result after certain event, business logic modules only need to be called the corresponding function of service logic callback interface.
From above-mentioned description, subscriber interface module provides interface logic, interface element realize pattern or style; Business logic modules provides service logic flow process, and concrete business function is realized.Subscriber interface module can allow user click Interface Element and usually call the concrete business function function in business logic modules.Because subscriber interface module has created service logic callback interface, only need to go call function just passable when being necessary, and not need to be related to how service logic realizes.