Six misunderstandings to build enterprise applications

xiaoxiao2021-03-06  64

Before your team is encoded, let's take a look at some mistakes that often appear in enterprise applications. Before how to do the focus, I want to think about what should be considered. Many programmers get knowledge from the book, then add some good things in the code, but also leave the same error in the program, so I will involve some frequent errors on enterprise-level coding, then brief description How to avoid these errors. 1. The type of data store you use is irrelevant. Designing a first step in applying to your data store. All applications are based on a database, which is not just a result. However, there are also some popular perspectives recently: you can use relational databases, XML databases, object databases, directory services, and more things. As a result, many companies have often exchanged these different forms of data storage without their own ideas. If the directory service is cheaper than the database, some companies will use directory services to replace the database, XML database is also because of its " Charming "and industrial vitality is placed in the application. However, the tendency to use any data storage in any case is ridiculous. Your performance will drop, the code will become more complicated, you will have no way to know what to do. Each data store has its own characteristics. For example: Directory Services is the best for frequent read and little write support. Verify and searching names and addresses are a perfect usage for directory services. However, if you often write some data in the directory service, you will find that its performance is lowered, so cases are the best for the database. It is very important to decide what kind of database that uses, for example: use an XML database without pulling the XML directory to the database. You have chosen XML, but never use XML. In my new book, I have these options. In fact, you will learn how to combine databases and directory services together, and how to pass data between them. 2. The particularity of the seller adds a shortcuting of the codeful task programmer to use shortcuts to speed up the coding speed, however, more often, these shortcuts become long-term defects. No matter how much time before the coding is completed, I always take a lot of time after the end, let me change the code, let me give the following example to get the version of the EJB and database table, a common version is in the table One field is inserted into the ID number, because Oracle uses Sequences to do this, MySQL uses an automated increment field, and other tables may not provide such numbers. In the case where I see, use it directly to access Oracle SequesNCE, or MySQL increment fields or other databases. In other words, EJB will not run on any database in addition to a specific encoded database; in fact, they are You can't work on different databases of the same seller. The result is heavy, short-lived, can't keep up with the company to change code 3. I need an editor or tool to write my EJB I often ask me to use tools to develop EJB. Clear, People want to know what I use to generate a remote interface, home interface, and execute the source code of the class. So in order to make the encoding simpler you must have a tool to help you do these duplicate things. If you change its framework in your code, or forget a punctuation there, or accidentally make a mistake. The result is the code compilation error and difficulty in debugging. Maybe I use vi and notepad to edit Java look very savings :), but I use Ctrl C and Ctrl V and 'YY', 'KK' and 'P' in these text editing tools, paste, paste The code is better than I am rooted in any editor and the used tool.

The result is that I have a higher degree of understanding of my code. I know anything in all things in my code. I don't say you should use an editor or tool (I am the most commonly used jedit); however, when you When you rely on these tools, you will have trouble. You can't make anything in addition to an editor with a week. You will be surprised that you don't recommend any tools in my book. This makes you finally have a valid logic's bean. And other components in your application. 4. I used technology, including JMS, XML, JAXP, etc., if you read my book and the article for a long time, you might go back to do this. I have been insisting on what do you need in the program, know that I have seen people's industrial vitality or calling this phenomenon. The most basic mistake I want to say is that all J2EE technology must be used in J2EE applications. If you don't use EJBS, JMS, JMX, XML, and other things in your application, you will feel you waste. Money. Anything is more than the fact. In fact, although in my last book, I am almost very hard to write a chapter JMS, this does not mean that JMS is not important; it is obvious that I have the application for the writing. JMP is required. . I have written a few applications that need JMS. I also have a few very cute easy-to-use JMS examples in the book, however, that version is all legend: sometimes not what you need. In any case, there is 50 times, you only need to use what you need, if you need all the techniques in a pair of servlets and JDBC code, insist on doing something: Don't add complex EJB, if you If you don't need it, if you need EJB, but the message driver bean is beyond the scope of your application, don't worry, in the end, you will still be happy to apply for you. 5. State Beans is a program more object-oriented. This is the most common problem, often correcting it is the easiest. Basic error includes method calling methods, for example: you might find some ways in a remote interface of a stateful session bean: public user create (String Username); public address getaddress (); public list getaccounts (); Public Boolean DeleteAccount (Account Account); here's the idea is that you need this bean to allow you to pass Username one time.

转载请注明原文地址:https://www.9cbs.com/read-84651.html

New Post(0)