In front of several "Swing sword" of, aroused our interest on the Swing technology, also attracted a lot of saliva and bricks. JavaEye on the recent quality can already see a lot of discussion and application of Swing introduction, this is a great change. But more students compared to the Swing application or a loss or even suspected: Swing can do large-scale application of it? Swing the future I would like to discuss some major projects in practice, is more meaningful things than simply have a chat some of the technical saliva.
Over the years we have been saying: Swing struggling to learn, not many used to see the application are not many large applications do it? Recently, friends said after reading Jidao, Oh Swing Better learn it, do something beautiful! In fact, this is not only a dilemma: a few years ago we still ugly one-sided beatings Swing, Flex Han said that the beautiful, suddenly someone brag about doing something nice to Swing, and really is not suited. Others say, Swing dying, Sun has to die, Oracle has to die .... Actually, in their eyes, and perhaps also to die Java, software development is also to die in the end .... that Swing applications can be bigger OK? Through their experience of participating in the project: this is really OK!
Swing has been doing the past few years development, the company had the honor in a large ERP project. The ERP project is large, with my NetBeans project where there are more than 150 million lines of code, not including other branches of the module group. In addition to front-end desktop client, there are browsers, and mobile terminals, but the most important thing Swing version of the desktop client. The Swing version of the ERP client has developed more than 7 years, JDK 1.3 has been upgraded from the current 1.6, IDE from IDEA, JBuilder to Eclipse, NetBeans. But the core framework has been no major changes, the application is more mature.
This is a large ERP system, a typical C / S structure, but also mixed a number of B / S structure and the mobile terminal module, but the main content or in the large back-end and front-end Swing. Mainly used to build the back-end J2EE framework, through the JBoss application server and MySQL database, Hibernate to do O / R, their package DAO layer and Business layer control of the business logic, and then conduct business Ejb API package. Finally, a Facade layer EJB (later transformed into a Servlet) to provide a unified access interface outside. This interface is the only access to the back interface, the "man guards the pass, Wan Fu Mo open" at the entrance, and then insert the login and session management, security control, logging, request distribution mechanisms such as clean and simple. Communication protocol, the previous EJB and IIOP protocol through an open API to provide remote call, and later found a very intricate communication EJB and "heavy", more complex kinds of control, efficiency is not good. Transformation of post-release package as provided externally by a Servlet interface protocol has become a HTTP. In this way, back through a port 80 in a similar manner WEB front end of a unified API to provide access. For many people, this approach may be a bit strange: Swing fat client, also used the WEB HTTP protocol to access the background. Hey, in fact, this trick Oh well, carefully pondering what will appreciate its beauty.
Swing front is a complete program, but also through layers of packaging, providing a layer-one correspondence with the server's API access layer, and finally through a single proxy class, on the back for a visit. How to transfer through HTTP Java objects? We do not like using the Web Services technology, but rather directly to the methods and parameters to call information such as serialization, HTTP submission to the background, the background distribution through the module, reflecting the approach to the implementation function, the resulting data to serialize, then compressed, returned to the client through HTTP. Client data extract, anti-serialized object API calls to return (such as various interfaces, buttons, etc.). This structure is very efficient and reliable. Even abnormal function, can be passed through serialization.
By way of HTTP, the server no longer need to open additional firewall ports, and web applications, like a 80 on the line. In addition, information such as html and web delivery is different from this structure, the intermediate transfer is compressed after the Java object serialization byte stream, and its efficiency is very high. Fat client is the structure, nature can handle more data processing and presentation, have the advantage over the browser, it is the right kind of enterprise ERP applications. Lightweight, efficient structure also provides a good service support capability: a normal desktop ERP can provide 100 simultaneous users online, more fluid use. This is no special budget to purchase specialized servers and building the engine room of the enterprise, is to force.
As to whether the Swing client can do good-looking, this depends on whether the intention was. Have to do, what UI technology actually does not matter, you can make a nice application. Here are two maps, is it nice or benevolent see benevolence and the wise see wisdom.
Swing through two years of development, but also summed up some experience, and share:
- Introduction to Swing high, there is a certain learning curve. Swing in the choice of whether to adopt enterprise technology, be sure to analyze the suitability of their team. Without a good backbone to lead half Swing, Swing makes it easy for the complexity of the code out of control throughout the project, and finally become a "good good good big garbage dump."
- Layers of code to try to take the framework of continuous reconstruction, optimization, multiplexing, not every person from engaging in their own set of preferences, it will be very easy to get out of control; code and style and even the same development tools should try to avoid maintenance trouble.
- Find a good artist. Graphic design is important, he (she) will be from a different perspective to the programmer to create and design UI, we must respect the art of design ideas, do not easily find fault with, to talk nonsense. Industry specializing in surgery, you know, we in the fine arts are mostly primary school level programmers. Once the design to determine, in strict accordance with the development of a unified style, each dialog box, each button, each icon. ERP in the tens of thousands to make a dialog box are "identical" really difficult, but should be the goal.
- Always from the "User" point of view the design UI. UI design development is the process of art can not possibly put a dialog box ERP systems are designed thousands of programmers at this time is half art, half of the users. There is a time to the brain, "user" and always beat yourself: this interface easy to use it? This report can read it? The position of the right button it? To do software is like building a building, the foundation seed is important, not important to seal up the windows, exterior paint is not important? Do stand a hundred years of quality engineering, you have attention to detail everywhere. Do not forget to live in the house is used, the software is used to use.
Then a brief introduction on the ERP. This is a designed specifically for large-scale manufacturing industry ERP, the control module covers the engineering design, drawings, material, BOM, procurement, sales, inventory, MRP, production, work orders, quality, finance, customer service, personnel, safety, etc. . Especially for "single produced by" type of discrete manufacturers. Users Wexford, Whetherford and other international giants, but also such a large state-owned CNOOC, more small and medium enterprises, I have come across only one computer in a private owner, but also with our ERP, but with the very good , was razed bandits!
Lastly is an incredible fact: This is a free software. Oh, these days, ERP software, for free, yes, fully and completely free, their play, business, learning ....... casual friends.
Friends to the site of interest to drag down the Dances of a hope that would be the ability to Xinxinbaopeng Swing. However, in the Chinese translation is still nervous, take some time for download. English first play it, I believe we can cope with the English. Website is: www.2bizbox.com , click, next, does not require registration.
Welcome to ERP like Swing and discuss with friends, I wish you all Happy New Year!