Software architecture acts as a concept, reflects two aspects of technology and business. From a technical point of view: Software architecture continues to update its content with technology, software architecture is based on current technology and some basic principles. First, some basic principles: Title Principles: The hierarchical is to reduce the key ideas used in software depth complexity, just like the society, the software has hierarchical structure. Modular principle: Modularity is an inevitable means of resolving software breeding, and modular purpose is to divide software. Interface Implementation Separation Principles With the continuous improvement of software modularization, interface programming rather than achieving programming can reduce the coupling between the complexity increases, so that each module is easier to improve. From this principle, the software has also made meticulous standardization from micro. There are two small but very important principles: Detail hidden principles clearly simplify complex problems, hidden in a ugly detail, allowing the software structure to be clearer. In fact, this principle uses very common, the package principles in the Java / C language and the Facade mode in the design model can reflect the spirit of this principle. Relying on the inverting principle As the software structure is further developed, between the layers and layers, the dependence between the modules and modules is gradually deepened, and the dynamic pluggable requirements of the module are increasing. Dependency inverting principles can be seen as deepening of the principle of separation, according to the spirit of this principle, software enters the tool era. This principle is a bit similar to well-known Hollywood Code: don't call us, we'll call you.
These principles have laid the value indicators of our software architecture. But the software architecture is based on the current technology. And each generation technology has architectural mode. The past is no longer said, let's take a look at the current popular technology, as well as the architecture that we can use.
Because object-oriented is the current most popular development technology, and the large number of design patterns makes the object-oriented direction, the database is the current most effective storage structure, the web interface is the current most popular user interface, so the most typical three levels of the most typical The architecture is based on the above techniques, with a database as a storage layer, with an object-oriented to realize the business layer, and use the web as a user interface layer. We talked from three-level architecture: Because of object-oriented technology and database technology, we increased data persistence on the basis of standard three-level architecture, to manage or bidirectional mapping, but there is no ideal implementation. technology. CMP and Entity Bean technology are complex, and the function prospect is limited, close to the edge of the eliminated. JDO and Hibernate are the late show of O-R mapping, especially Hibernate, and feature is quite complete. It is recommended as the preferred service layer as a long-lasting layer, because the current business is increasing and frequent, so we must have enough agile technologies to ensure our ability to adapt changes, in the standard J2EE system session bean is responsible for business processing, and Nice performance performance, but the EJB system is used to change the business architecture mode, and its complex and expensive, the business code is transplantable. As a lightweight architecture configured by a bean, Spring is implemented, which has little effect on the business architecture, so it is recommended as an intermediate business framework. In the user structure layer, although servlet / JSP / JSTL / JavaBean enables the MVC architecture, it is too rough. Struts is relatively perfect for the MVC architecture. TAPERSTRY also enables the MVC architecture and uses an event-based approach, very attractive, which is not mature enough, we still recommend Struts as the user interface infrastructure. Because the business layer is the most decisive significance in the three-level architecture, let's go back to the business layer to analyze, in complex business, we often need one or more of the following basic services: Transaction Consistency ACID (Tool : JTA / JTS), concurrent locking service Concurrent && Lock, Pool Management Service Cache, Access Control Service (Tool: JaaS), Process Control Service Workflow, Dynamic Implementation Service IoC, Serial Message Service (Tool: JMS), Load Balancing Service Blance, etc. If we do not use heavyweight application servers (such as WebLogic, WebSphere, JBoss, etc.) and heavyweight components (EJBs), we must implement some of these services themselves. Although we most case, do not need all of these services, but it is not easy to achieve. Fortunately, we have a lot of open source implementation code, but the open source code is often not easy. As XML is more important as the structured information transmission and storage status, some XML document operation tools (DOM, Digester, SAX, etc.) are more important, and with XML Schema's Java Binding Tools (JAXB, XMLbean et al) tools Mature, using XML Schema to design the XML document format, then use Java Binding to generate Java Bean to become the main programming mode, and this further makes the data center to XML, so that in small and medium data, more inclined tends to be XQuery Query language XML database. There is also a trend, Microsoft, IBM, etc. have developed a large number of intermediate software such as the Microsoft Office, which can generate a very practical function from XML Schema to generate an entered page. There is also a wide range of applications of Web Service, which will have a very significant impact on the structure of the software. As for the service architecture (SOA) prospects, when the three-level architecture walks into history, it is still difficult to set up.
The development of AOP will also have a deep impact on the software architecture, but in the object-oriented architecture, regardless of Aspectj or JBoss-AOP is aspectwerks, nanning has its own serious problem: the maintenance is very poor, so it will be very It's hard to walk. Maybe as a good idea, it will show your hands in the Web Service. RDF, OWL as a landmark language of the W3C semantic model, is also difficult to imagine that it can play a great impact on the current business architecture. However, if it is as claimed, the structure of the information is widely changed. Then there will be far-reaching impact on the software architecture.
Some advice on architectural design: Try to establish a complete lasting object layer. You can get high-rewards to slide each function, block, each module, depending on the appearance of other modules, can not rely on static data to implement IOC mode, should Depending on the data feature interface, the static data is only the architectural design of the data feature interface implementation XML is support rather than dependence. But you can provide a single XML version of the implementation
From a business perspective: Software architecture should be deeply reflected in the business structure of the internal rules of the business, but because the business changes frequently, the software architecture is difficult to maintain constant, but the frequent changes in the business should not be a large scale of software architectures. Cause, the software architecture should be a change-based architecture. A business has a reason for stabilizing in a period of time (not talking), there are many use cases inside the business, each of which has a fixed rule, and each rule has some items available, each item. From a certain dimension, it is measurable. Our architecture must first ensure that the perfect adaptation of each measurement method, many failed architectures are because many measurements have changed this micro-change.
Every use case has rules, we are analyzing business use cases, often assume some rules to be priori, lasting, and later business changes often prove that this view is wrong, but often our architecture has been Paying the cost of irreparable. A large number of facts prove: the change in the rules often use the root cause of example. So our architecture should be adapted to the rules of the rules as much as possible, and establish rule templates as much as possible.
Each usage is related to different roles. Each use case is inevitable because of the change of roles (Note: not replace, but enhanced or weakened), it is important to pay attention to the various possibilities of the role, and the design of the architecture has a light meaning. In our current three-layer architecture, the role is perfect correspondence.
A lot of use in a system is interrelated, taking into account each usage may have different special cases, so in architectural design, try to use the inversion principle. Message Communication Mode (JMS) can be used as schema license. This reduces coupling.
Now let's talk about the impact of business stability on business. The existence is reasonable, and it is of course correct here. The business is existent, so the reason for the existence of business is to ask the reasons for the need for different roles and the reasons that like to use the current business use case, all such characters should be reserved in the system. "Seduing" has several principles in architectural design. It can be considered: use case as possible as possible as much as possible, as much as possible, as far as possible, the independent Issue independent principle is pursuing simplicity here, the example is not provided here, and the example will be available in later updates.
The relationship between the relationship between business and modes is often similar to some of the regular patterns. But over time, slowly and the previous mode have different modes. This is a normal phenomenon. But this is very high for system architecture, requiring system architecture to adapt to some modes. Here we should notify the mutual role changes between the use cases as soon as possible to prepare for architectural updates.