Recently, ESET add my domain name to the black-list of their database. You can’t open my site and been warned my site is not safe if your PC is running the ESS or EAV. Why Eset block my site?The answer is obvious. That is reason that you come here. I promise that my site is pure, no virus, no spyware, no Trojan, no pop ads. You can test my word through intalling Kaspersky or other Antivirus Software. If you want open my site and take latest escalation ID & Activation Code, close your ESET software(disable antivirus and antispyware protection function temporarily) or by proxy or virtual machinor. You can also feed the RSS source http://feed.loserblog.cn.
Recently, ESET add my domain name to the black-list of their database. You can’t open my site and been warned my site is not safe if your PC is running the ESS or EAV. Why Eset block my site?The answer is obvious. That is reason that you come here. I promise that my site is pure, no virus, no spyware, no Trojan, no pop ads. You can test my word through intalling Kaspersky or other Antivirus Software. If you want open my site and take latest escalation ID & Activation Code, close your ESET software(disable antivirus and antispyware protection function temporarily) or by proxy or virtual machinor. You can also feed the RSS source http://feed.loserblog.cn.
B/S framework MVC system design
Improve code reuse, increase development speed and reduce maintenance Laws of software development has become a model is the increasing demand. Framework, model and the interface it with this孕育Health.
MVC is a design, make it mandatory application of input, processing and export of separation. The use of MVC application was divided into three core components: model, view, controller. They deal with their respective mandates. MVC design pattern used to make developers can focus on how to solve real business problems.
Why use MVC
Most Web applications are used as the JSP, ASP, PHP, or CFML such a process to create the language. They will query the database such as the data layer, as HTML code and the code of that mix. Rich experience in the data from the developers will be separated from that layer, but it usually is not very easy to do, it requires careful planning and continuous attempt. MVC fundamentally mandatory to separate them. Although the structure MVC application needs some extra work, but it gives us the benefits is beyond doubt.
First of all, the most important point is to share views more than a model, as I mentioned, now need to use more and more ways to access your application. In response, one solution is the use of MVC, regardless of the user interface to Flash or WAP interface, using a model can handle them. Since you have the data and business rules separate from that layer, so you can maximize the reuse your code.
Since the return of model data not formatted, so the same components used to be different interfaces. For example, a lot of data that may be used to HTML, but they may also use Macromedia Flash and WAP to that. Models have a lasting state of management and data processing functions, for example, based on conversations and e-commerce shopping cart process to be Flash site or wireless networking applications by the reuse.
Because the model is self-contained, and with the controller and the view of the separation, so you can easily change the application of the data and business rules. If you want your database from MySQL migrate to oracle, or change your RDBMS based on the data source to LDAP, you just change the model can be. Once you have achieved the correct model, regardless of your data from the database or LDAP server, the view will show that they are correct. As the use of MVC applications of the three components are mutually antagonistic, a change which will not affect the other two, based on this design ideas you can structure a good-coupling of the components.
For us, the controller also provides a benefit that can use the controller to connect the different models and views to complete the needs of users, so controllers can be constructed for the application to provide a strong means. Given the number of reusable models and views, controllers can choose according to the needs of the user model and then choose to view the results are presented to the user.
2. B / S model of the design framework MVC
Can not be displayed, using simple text description:
Information layer: Relational Database
Persistent data layer: DAO
Model layer: business objects (Business Object), business logic, business agent interface, controller
View layer: View
Customer Tier: IE
3. Description of the design model
According to Figure B / S three-tier architecture design patterns, we have placed a separate database information for the bottom layer, data persistence layer, layer and controller of the model as the middle layer, the view of the show for the client interface, at the top , Is also directly accept the operating level.
3.1.'s Persistent data
Durable means of manually or use other means to enter the data in the application can still exist after the operation ended. This requires that data be persistent to the database or disk file.
Object-oriented development is today's mainstream, but also to the use of relational database, in the enterprise development environment, the object – the mapping of the (Object – Relation Mapping, referred to orM) will become a persistent operation An important link. orM and lasting around data access, in the field of software development of a data access objects (Data Access Object, referred to DAO) design pattern.
The java application can be programmed directly through JDBC to access the database, in the enterprise application development, through JDBC programming to develop their own DAO API, the operational data access package, calls for reunification of the business.
3.2. Target business
Business objects (Business Object, called BO), which is the real world of abstract entities of the software. It can represent people in the field of business, location, things and concepts. Including operational status and behaviour.
If a class can be used as a business object, then it should have the following characteristics:
a, including state and behaviour
b, on behalf of business people, locations, things and concepts
c, can reuse
Business objects can be divided into three types:
a, business entities targeted
b, business process objects
c, target business events
Through different types of business combinations call each other object, a业务逻辑层, is the core of the model layer.
3.3. Interface business agent
Acting interface directly to the business, the combination of business objects and lasting framework to deal with the actual business logic, business agents use interface that allows the use of these agents controller interface, rather than a direct and lasting framework of interaction. This practice helped weaken the upper web applications and lasting framework of the relationship between the framework and improve the sustainable model of the relative independence.
In addition, the need for a DAO model to weaken the application of business logic and database access logic of the relationship, when the use of durable framework of the time, DAO business model can be targeted and durable framework of separate, when the mechanism of lasting change, this Kind of change will not have an impact on the business object.
3.4. Controller
Controller accept user input and call to complete the model and view the needs of users. So when a Web page, click the hyperlink and send HTML form, the controller itself does not export anything and do anything to deal with. It is receiving the request and decide which model component called to deal with the request and then determine which view used to display model to return to handle the data. Controller responsible for the reunification of circulation and control procedures, the functional equivalent of the CPU. When the client sent the request after the operation, requested by the Controller and, upon request, receive calls business agent interface to fulfill the request, the request to return to the final results.
Struts MVC framework is a model in the development of the controller to play the role of web application framework. It procedures in the control layer, is not responsible for achieving specific business logic, is only responsible for creating and calling interface model to achieve business logic of the request. Struts framework can be unified control process, the unified control of a single incident has broken down at the request of control.<
br/> And the control of view, the model of separation of the benefits that neither the business logic and the view in which components change, they only need to change that part of their own, without the need to design other level.
3.5. View
View is to see and interact with the user interface. The old-fashioned Web application, the view is composed of elements from HTML interface, the new Web applications in, HTML still in view plays an important role.
How to deal with the application's interface has become increasingly challenging. MVC a big advantage is it for your application with many different views. In view of the fact there is no real treatment occurred, whether the data is stored on-line or an employee list, as the view speaking, it is only as an output data and allows users to manipulate the way.
Struts framework also provides a view of components, based on the view Struts API, so that procedures can be developed faster, the agency is prohibited, the most important thing is to be completely separate controller and view, to weaken the view of the hybrid control mechanism, the real The module independence.
3.6. Aggregate
Now we sum up the MVC process, the first controller to receive the user's request, and decided which model should be called to deal with, and then model with business logic to handle the request and return to the user data, the final controller with the appropriate model to return to view format The data, and through that layer presented to the user.
4. The relationship between the level
From the view of the persistent layer, they can only call it under a layer of the interface, not by leaps and bounds call, so that all levels of relatively independent, so as to achieve an increase reuse, reduce maintenance, modification workload and modular目标.
5. Flowchart software development projects
Can not be displayed here
6. Application of Technology
Information layer: oracle
Durable layer: Custom DAO framework, java EJB entity Bean
Business objects: custom class or third-party API, java EJB Session Bean
Business agent interface: interface
Controller: Struts Action
View: Struts taglib, custom taglib, JavaScript
7. Team
Demand for analysts: responsible for the operational requirements of
System architect: each module responsible for the system architecture
System Designer: Design module responsible for the business objects and business logic framework
Software Engineer: responsible for the realization of business logic, the controller and view control
Interface design: responsible for the interface design
8. Development model
Whether the overall framework of software or sub-module structure, must have a clear division of labour between the teams, the following simple description of the module development process
Analysts demand – a business logic analysis, system architecture to the completion of the division.
System architect – are in demand analysis, system architect demand for the first design concept model, in the work of this step, businesses need to target carefully abstract out and design a module of the overall framework, to the system after the completion of Designers.
System designers – in access to modular design framework, according to the design of the abstract concept into a business model object model, based on demand and the need to design a module of the entire business logic framework and interfaces. Respectively, after the completion of the logical framework and interfaces to the business logic is responsible for the completion of the software engineers responsible for the controller and view the design of software engineers.
All software engineers in the design documents received after the completion of the code can begin simultaneously editing and design view programming work.
After the software engineers to work after the release procedures, to test engineers, test engineers view complete test case under preparation, and start the test, after the completion of the need to prepare the test reports. If a refund is BUG software engineer, if there are changes in business logic, there are software engineers returned to the system designers to redesign or rewrite business logic. No problems from software engineers to complete the module responsible for their own user's manual.
At this point, finished module development, delivery.
9. References
This article refer to the following documents
a, CSDN technical articles published in
b, Sun Weiqin the "proficient Struts: MVC-based Java Web Design and Development"