The database-centric software age has passed, and the database Age has already ended. When I saw so many people struggling with ing between objects and databases on the J2EE journey, I think I should have shouted.
In fact, some people have shouted this sentence a few years ago. Because of the advent of the middleware era, it actually means the end of the database era. This is what we call the same thing: if you pay attention to databases, your J2EE system cannot be completely oo. Only when you ignore the database can your system be completely oo, specific features such as database performance tuning can be implemented by the EJB container or O/R Mapping Tool.
Many years ago, most corporate programmers, including myself, started our career from databases. The earliest was DBASE/FoxPro, and later we had SQL databases, oracle has pushed the database era to its peak.
Whenever there is a new project, the first step is to first design the table schema and then use SQL statements to implement business logic. This development mode has always been repeated, it was later added with Delphi/Vb, and they only undertake the implementation of graphical display. The biggest problem caused by this C/S structure is: it is very difficult to maintain, modify it, and migrate a hundred times.
The life of software lies in motion. When it needs to develop, who is the sorrow of the best software engineer if he is helpless?
Now more people begin to accept the B/S structure, but many of them do not really understand why the B/S structure is required. The multi-layer architecture represented by B/S is the real purpose (therefore, the pseudo multi-layer B/S system is everywhere ).
The multi-layer architecture separates the display function, business operation function, and database function in the previous system, so as to eliminate the coupling and impact of each other, so as to achieve loose coupling and good maintainability.
I. in terms of design: due to the full separation of implementation layers, the business operation function becomes an intermediate function (middle layer), which does not depend on the specific presentation layer technology (JSP/html applet, etc ), it does not rely on specific database technologies (Oracle/SQL Server). Business computing functions run on J2EE application servers. Does our business computing functions no longer depend on databases?
II. of course, the multi-layer structure brings performance problems: when the client accesses data in the database, it usually needs to go through multiple layers, which is very performance-consuming, how to minimize database access is the primary solution of the J2EE application system. Using Stored procedures does not solve this problem. The execution of stored procedures still belongs to the backend, there is no way to shorten client requests.
The fundamental solution to the performance problem is to use the object cache. Now, the huge memory space provided by the 64-bit CPU provides the hardware foundation for a single cache computing. More importantly, this type of cache computing is scalable. by increasing the number of application servers through the cluster caching mechanism (such as jbosscache), the cache computing capability of the entire business logic layer can be improved, abandon the old thinking that overwrites memory in the past.
3. Do I need to design a data table first at the beginning of system analysis? The answer is no. Using UML as a representative of object-oriented analysis and design methods has become a powerful tool. With the popularization of model-driven Analysis and Design (MDA, database-oriented analysis methods are gradually being abandoned. programmers with deep traditional database analysis habits must face and accept this challenge.
Throughout the J2EE system development process, the database has been reduced from the central position to a pure technical implementation. The database is only a means of State persistence (file is another implementation method ); what is persistence? This is relative to the memory cache status. Persistence means that the State data can be permanently stored when the memory is powered off, but if the J2EE application server runs in a cluster for 7x24 hours, it will never become a machine, is there a need for persistence?
Obviously, the database has become the same level as the file system in the operating system. The era of taking it as the center has really ended. IBM's early open-source DB2 database has strongly told us this.
For beginners of J2EE, they should discard the past two influences as soon as possible: Process language programming habits and database-centric design habits, from the new object-oriented perspective (OOA, Ood, oop, and AOP) to design and develop your J2EE system, J2EE design and development three treasure: model, patterns and framework.