Agile master MARTIN: What is SOA?
You may have learned a lot about the good and the bad. This articleArticleDespite the rumors of the merchants, we will describe service-oriented programming in a simple and easy-to-understand way. This is a unique introduction to SOA.
In daily business, some things do not change often. For example, American gas stations have been selling gasoline in gallons, while restaurants still use menus, the dentist will still sell cleaning supplies every six months. Each type of business will have some aspects that do not change frequently, and this part usually occupies the vast majority of the business. These are called core business functions ).
There are also some changing things in the business. Prices, tax rates, product categories, new products, new market strategies, advertising, new business areas, new customers, and so on. Indeed, to survive, enterprises must change rapidly. However, it is critical that those changes do not affect core business functions.
Software developers have long understood the principle that fast-changing software modules should be separated from unchanged parts. This principle is independentProgramOr the system is sometimes referred to as "the principle of mutual closure ". The application in the enterprise's information management system becomes SOA.
SOA is a practice that separates core business functions that remain unchanged into independent services. These services are whitewashed methods called by multiple presentation layer programs. The presentation layer program is a program that is easy to change and is used to present data to users or receive data from users.
We think about shops on the Internet to help us understand. The customer interacts with the display program of the store site through a browser. The presentation program parses the customer's operations and then calls services such as obtaining the data of the current category or requesting the registered customer. Note that these services do not know that they are interacting with the web site. They are like interacting with thick clients, or a 3270 green screen interface (3270 is a mainframe system of IBM, and applications on it often appear in the form of green screens, it is often called a "green screen" application ). They simply return the data that may be used by web systems and standardize the format.
SOA is actually the same. The rest is the details. At the highest Abstraction Level, SOA separates frequently changing elements from infrequently changing elements. But why is this so important?
Let's take a look at the shops on the Internet. It presents the user with a classification, so that the user can move the item into or out of a shopping cart, and finally realize the order. The presentation of these contents is quite changeable, and market players like to make them change from time to time. For example, they may want to compare a shopping cart to a scroll bar on the border. They want more or less additional instructions on the product list. They want different colors, fonts, and la S. They really want applets, jstart clients, Ajax, and countless other presentation options. However, all these functions have nothing to do with the core business functions encapsulated as services. Regardless of the weather on the presentation layer, these classification and registration processes remain unchanged. This is why separation is so important. It ensures that information processing is protected in the erratic display.
However, the presentation is not the only one that is easy to change, and the business functions are the same. Think about our store again, maybe we need to add a kind of high-quality wine to our products. For tobacco and liquor sales, the age of the consumer needs to be verified. Suppose we have a service that can provide verification. This service is called whenever there is a tobacco or liquor order. The decision to call this service does not come from the presentation layer, and of course does not belong to the business. It is the business process required for a specific procedure. Changes in the business process are as disturbing as rabbits are beating. If the business grows, they will add more steps and branches to their business processes. The services that need to be called in the processing process are unordered, but the processing process is required. Therefore, we need to separate the business process from the presentation layer and service. If it appears in a single program, the Smalltalk language is called mode-View-controller for such separation.
It is worth noting that so many technologies are similarly associated with SOA. This is because SOA is not a specific technology, but a methodology that decouples optimized business functions from a variable process and presentation. This is the MVC of enterprise software.
In my next blog about this, we will go into the details layer and pay attention to how these services are built and how the presentation and process are implemented.
(Original link URL: http://blog.objectmentor.com/articles/2007/04/11/what-is-soa-really; Robert C. Martin's english blog URL: http://blog.objectmentor.com /)
Author profile: Robert C. Martin is the president of object mentor and a senior consultant in the field of Object design, pattern, UML, Agile Methodology and extreme programming. He is not only the author of Jolt's award-winning book Agile Software Development: Principles, models and practices (Chinese version) (Agile Software Development (English version, or the author of the bestselling book Designing object-oriented C ++ applications using the booch method. Martin is the editor of pattern development ages of Program Design 3 and more C ++ gems, and has co-authored XP in practice with James Newkirk. He is a well-known speaker at the international conference of programmers and has been an editor of C ++ report for four years.