We know that enterprise-level development, the framework brings a variety of benefits.
When the Internet site project development, the focus is different, is the framework still satisfactory?
Java Development Web site, with pure JSP servlet and SSH advantages and disadvantages. Analysis.
Reply content:
This problem is actually imaginative achievement here inexpressible, but from seeing this invitation, there is the impulse to show off the friends.
First, I started programming from QBasic and went through QB to VB,VB to ASP (without. net), ASP to jsp,jsp to PHP, and then back to Java EE. This process may cause my opinion to be different from the mainstream view, I hope you understand.
The Java EE does not equal spring struts hibernate, there are various other options, SSH is not the only or not the best choice, here is not the table.
Ask a question first, what is Jsp/servlet can't do, and SSH can do? Is there no web app before ssh?
Some people think the servlet is silly, but you look at the core entrance of struts dispatcher, not a servlet. You think JDBC is difficult to use, Hibernate function is finally implemented with JDBC, and a lot of batch processing, or the original SQL is good, so that hibernate has to provide a native SQL interface, MyBatis is from here to dig away a lot of users.
In many cases, what SSH does is simply encapsulate the functionality that JAVA/JSP/SERVLET/JDBC originally had, encapsulating it as a different API, making the original Java-written code into XML, and then running the XML in the JVM with a Java-written interpreter. So, I think SSH is actually a set of DSL (domain-specific language) that is created for the field of web development. The language begins with XML and now shifts to the Java annotations annotation, slowly returning to the Java language itself.
Not very comprehensive, struts is to get unfamiliar with the HTML/CSS/JS Web programmer out of their writing business logic, Hibernate is not familiar with SQL programmer to get rid of SQL write database program, spring is to unfamiliar Java interface, The reflective programmer is freed from interface reflection to write AOP. And these are replaced by the original DSL in the relevant field, which is somewhat ironic, right?
If the struts developers do not have various <%= "'" +xx.yy () + "'" in the JSP mixed Java fragment%> nested parentheses in the sea, do you think they would have thought of doing struts?
If hibernate developers don't get dizzy in the SQL join chain, do they hibernate?
If the developer of spring does not spit out the number of exceptions to the Java reflection, will there be spring?
If you just want to be a mediocre yard farmer, learning ssh can help you find a good entry point.
If you want to have a deep understanding of the system, the language, the framework, to learn the functions provided by the language itself, to learn the servlet, JDBC, Java, to see how to use them to construct a common complex system, perhaps the next 5-10 years, people will bring up the Java EE, said the name of the framework you created, And no longer what spring struts hibernate.
We always want cohesion to be low-coupling, but the two are usually contradictory; if you are willing to give up one of them, you can go farther on the other. (The opinion here is biased, please read the comments in the comment of Spring Thunder)
To prevent someone from saying u can u up.
Github-zhblue/crud:crud is really urgly coDed--Database rapid prototyping system laxatives
First you have to figure out the relationship between the two concepts servlet and ssh ~ ~ actually SSH is basically based on the servlet implementation. For example, a bicycle was the only means of transport for a long time when someone invented the bicycle. It can be found that the bicycle long-distance riding is not generally tired (large-scale application development, all the wheels have to be repeated manufacturing) so based on the bicycle has derived a lot of such as electric bicycles, motorcycles, electric tricycles, etc. these are for different applications of the birth of the Environment (actual project Many of the servlet developments are repetitive, so everyone pulls out a common pattern to encapsulate them. And on this basis a dedicated group of people to optimize a set of code ~ This is the SSH origin) have a person to maintain at least to ensure that your code bugs less vulnerability and less security high ~ and someone to write you a tutorial such large-scale development when the time-saving ~ ~ Then you will use the servlet?
Of course, if one day you want to build an electric car yourself, then you need to study the servlet, because the servlet is simply to complete the PPT production independently you just need to write a 5000 level with jsp/servlet, you can feel the charm of the framework Ah! The problem of development efficiency, simple to write a few pages with the servlet, is true enterprise-class application with servlet will be exhausted, management is not convenient. Using the SSH development project in the original company, the project is relatively large and the development cycle is very long. Later, there were projects written with the servlet JSP, and the project was relatively small.
How to say, the general small project with the servlet JSP really can do the completion of the SSH framework, but the development of large, many frameworks packaged public logic needs to be implemented by itself, and always feel that the code modularity is not as clear as the framework.
Typically large Java Web projects use frameworks, not just SSH, but also SSM (Spring,springmvc,mybatis), which can handle common logic like request parameter type conversions, transaction management, and reduce the coupling of code implementation policies in the form of configuration. The development and maintenance of large-scale projects will save a lot of time.
Framework is a more advanced reusable tool, the principle of implementation is jdbc,servlet and other basic things.
I hope to be of some help to you. Shouldn't it be Nodejs+socket now? The advantage of JSP servlet is to learn simple, belong to the Javaweb application layer of the underlying API, it is easy to grasp the operation mechanism.
The advantage of SSH is that it is easy to use and handles a lot of things for you, most of the time you just need to go with the routing, write the controller on the line. But because its internal design is complex, when you want to customize some classes based on the extension interface it provides, you need to understand its internal design and the relationship between classes and classes. But most of the time you just have to write Controller,service.