[Phase 1 outpatient highlights] Quick control of lightweight Java EE Enterprise Application Development

Source: Internet
Author: User

The technical clinic is a BKJIA Community brand topic. A visiting expert is invited every week to answer questions from technical netizens. From popular technologies to cutting-edge knowledge, from technical Q & A to career planning. One topic for each issue, leading the latest and most popular technology!

This special invitationInstructor Li Gang, author of lightweight Java EE Enterprise Application Practice edition 3rdTo answer typical questions encountered in Java EE Enterprise Application Development. You are welcome to ask questions and discuss them with experts!

View the highlights of this outpatient record:Http://doctor.51cto.com/develop-261.html

Participate in the latest technical clinic: survival rules of O & M engineers

Featured questions and answers from current users for your reference.

650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/1243094242-0.jpg "/>

Q: I have been studying Java for two years and have been engaged in J2EE enterprise-level website development for nearly a year. I want to learn Android, but some people say that if I want to learn Android, then you will be insulated from the knowledge of J2EE, and you do not want to leave it in this respect, and do not want to be insulated from it. A conflict arises. Please give me some suggestions. Thank you!

A:With solid basic Java skills, Java developers can quickly develop their applications to Android. For how to quickly transition from Java developers to Android development, You can first learn about crazy Android handouts, which should be helpful to you.

For details about how to learn Java, Java EE, and Android, refer to the learning route diagram at http://www.crazyit.org/thread-5953-1-1.html.

Android can be fully integrated with the existing JavaEE technology: Because Android is only a mobile client, data storage and computing for enterprise applications are completed on the server. The Android client can make full use of the advantages of "convenient portability and convenient Internet access" and be used as a client for enterprise-level applications.

 

Q: Hello, Miss Li. I would like to add a question to my question:
1. Suggestions on using these frameworks and performance optimization.
2. In terms of code optimization, I hope I can give some advice on architecture optimization.
Thank you very much. We look forward to your reply.

A:Performance optimization can be considered from the following aspects:
1. Java programming code style, such as using the String quantity as much as possible, avoiding repeated new instances multiple times, and using the displacement operation instead of multiplication and division operations.
2. Optimize the underlying database design, such as index creation and table sharding, and Optimize Query statements at the persistence layer.
3. Start with data caching. Using an appropriate cache policy can reduce the number of interactions with the underlying database.
4. With "static response", the server can use the page cache technology to make the frequently requested pages static cache, so as to avoid the need to regenerate the response page for each request.
5. To improve server performance, you can consider using cluster to increase load balancing and fail over.

 

Q: I hate Hibernate. Hibernate isolates programmers from databases. Although Hibernate programmers can develop quickly for a long time, the execution efficiency of written code is very low, I don't think Struts + Spring + jdbc is enough to operate mysql directly than jdbc. Many programmers I interviewed have no knowledge about the database, and I don't know how to optimize the program optimization. It is totally code stack. I don't know how the teacher understands Hibernate?

A:I agree with you! A few years ago, I even heard from students from other training institutions on the Internet: With Hibernate, JDBC is not needed in the future. At that time, I tried to refute this idea.

However, Hibernate does not need to be "hated". The key lies in how you use it, because Hibernate also has performance optimization.

Just like when I teach Hibernate, I always turn on the SQL debugging option, so that we can observe in real time what Hibernate does for us, so that we can perform "targeted" optimization.
In fact, Hibernate has made a lot of efforts in performance optimization: for example, the delayed loading of Hibernate is essentially a dynamic proxy mode), the status check before the update, and the Session-level cache, if you make good use of these features in SessionFactory-level second-level cache, Hibernate performs better than simply using JDBC. Note that JDBC is used alone. Because JDBC is used well, it can also implement caching, delayed loading, status check before update, and other mechanisms ).

In fact, I have a deep understanding of your "dislike"-I even advise beginners not to use JBuilder early tools such as Eclipse when learning java, because they also isolate programmers from real Java programming, those java learners will be at a loss after they leave the IDE tool and even change the IDE tool.

-- So I suggest that beginners do not use IDE tools first. When you really understand the menu and press a button every time you click in the IDE tool ...... Why does the IDE tool use the IDE tool after doing so? In this case, you can freely switch between various IDE tools to achieve the following: without IDE tools, you can develop IDE tools quickly. You can also develop some IDE plug-ins to accelerate development to a greater extent.

 

Q: Hello, Miss Li! First of all, thank you very much for writing this book, which has brought me into the world of Java EE development. It has helped me quickly understand Java EE and successfully made two small projects, A slightly larger project is currently in progress. Let me talk about my confusion now. I hope Miss Li can help me solve the problem. Thank you.

My questions are as follows:

1. Because the project is completely self-developed, I don't know whether my design is standardized, whether it is safe, or whether it is highly efficient, because my project has a small amount of data, the logical relationship is not very complex. Now, the project on hand is a bit complex, and it is difficult to hide it. Our project team has just a few people. We are all students. I personally feel that all the projects we have developed are relatively shanzhai. The starting point of Project creation is to develop functions, no matter how ugly the code is, how bad it is, how unscalable it is, and how it cannot be reused, I personally come to the point that it is normative, I don't know how to standardize my development, my small team.

 

2. solutions to problems in the project

Although various problems have occurred in the project so far, fortunately, it seems that all of them have been solved. Here we use the word "like" because of some problems, in fact, the solution is also solved, but if you are more careful, It is not solved. My personal solution is generally: ① CSDN posts ② Q & A in the QQ group ③ There will be no other way for google, and there will be no good communication with other team members, it is mainly because it is laborious to communicate with the personnel in the team, and it is a waste of time.

In view of the many defects in the above several ways, I would like to ask Mr. Li how to solve the problem quickly when I encounter a problem that I don't know. Instead of wasting a lot of time posting and replying.

 

3. Problems in our current development project

Because some small systems such as ERP are developed, there is little access to network programming and multithreading, and it is still necessary to do this, however, I feel that the chance of using the SSH framework to access these things is very small. I don't know if I think too narrowly.

Thank you, Miss Li. Hope to reply.

A:1. Standardize this thing. On the one hand, we can use the Norms popular on the Internet and exposed by some companies. On the other hand, we can also formulate some agreements based on our own ideas and conclusions. But if you want a higher level of specification, you can only participate in some of the software industry specifications that are common internationally, but these may not be suitable for your small company.

2. The solution to the problem depends on your understanding of the technology. In general, if I encounter a problem, I should first look at it by google. If I cannot find it, I should carefully look at its manul, guide, and so on. If I still cannot find a solution, I should log on to the relevant jira to look for it, we can't solve this problem. We can track the source code and look at the underlying details. Basically, we can solve this problem based on this idea.

3. That's right. The multithreading, network communication, and reflection you mentioned are the basis of Java and must be well mastered.

 

Q: Hello, Miss Li:

I have been working on java for almost two years. My usual job is to use some frameworks to quickly complete development tasks. I feel that everything I learned follows the project, and I learned a lot from it, can you give me some suggestions for improving your capabilities? As a java developer, how should I plan my own development path?

I personally think that data in a project is an important part, so I will pay more attention to some database things. Am I right? If it is correct, from the project perspective, what knowledge should I learn about the database? How to Learn?

We look forward to your reply!

Thank you.

A:It makes sense. In this case, it technology is based on data.

All developers need to complete enterprise projects in the enterprise-this is what we need to do after getting the salary. However, as a programmer who has ideas and hopes to improve, he cannot just meet the company's project requirements. Instead, he should try to embody his own design philosophy in project development: Change several implementation methods, think about how to make yourself "more lazy"-try to make your projects "generic" and split the code and business code in the project, extract common code to simplify the development of subsequent projects.

And think about making the code more elegant and concise? And how can we minimize the number of changes to a project during later project modifications and upgrades?

After learning the common SQL syntax and database management, you can concentrate on database performance monitoring and performance tuning.

 

Q: Hello, teacher.

Is it necessary to master and use Struts + Spring + Hibernate in actual development?

I can also use one of them to do one thing.

What are the advantages and disadvantages of Struts + Spring + Hibernate? How can we better master it? In which development environment is the most suitable? Ask the teacher for answers.

A:In fact, it is not necessary to use Struts2 + Spring + Hibernate, but this combination has a large general type. To put it simply, this combination is a combination that does not require selection or evaluation. Many companies and projects are in use, and it features high stability and good scalability.

For Hibernate, as a persistence technology, the main function is to allow users to operate databases in an object-oriented manner. However, for large volumes of centralized data access operations, performance has no advantages. In this scenario, you can use MyBatis instead of Hibernate.

For more information about Struts2 + Spring + Hibernate integrated development, see lightweight Java EE Enterprise Application Practice.

 

This article is from the "BKJIA technical clinic" blog, please be sure to keep this source http://doctor.blog.51cto.com/939235/882833

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.