当前位置:网站首页>Interviewer: what is the difference between SSH and SSM frameworks? How to choose??

Interviewer: what is the difference between SSH and SSM frameworks? How to choose??

2022-06-23 01:56:00 Java technology stack

source :blog.csdn.net/horero/article/details/54236833

I have used SSH Frame for a while , Finally, when optimizing the project, decide to use SSM frame , Here are some simple differences between the two frameworks .

SSH The frame is Struts+Spring+Hibernate and SSM It means Spring-MVC+Spring+MyBatis, Just from these two abbreviations, you can see , If we compare the differences between the two, we mainly compare Struct and Spring-MVC as well as Hibernate and MyBatis.

SpringMVC contrast Struts

  1. Struts and Spring-MVC Are responsible for receiving and forwarding , But both are aimed at request Your request is very different ,Struts It's about a Action Class to make the request , That is, a Action Corresponds to a request class , So class interception , The requested data class is shared . and Spring-MVC For method level requests , That is, a method corresponds to a request , It belongs to method interception , The requested data method is not shared .
  2. Spring-MVC There are relatively few configuration files , Easy to use , It can accelerate the speed of software development , Experience effectively .
  3. Spring-MVC The entrance to is Servlet Level and Struts The level of is Filter Grade .

Hibernate contrast MyBatis

in the light of Hibernate and MyBatis Operate on persistent classes , The differences between them can be sorted out as follows :

  1. Hibernate It's a kind of O/R Relational type , That is to complete the mapping between database tables and persistent classes , and MyBatiss It's for you SQL-Maping, Personal understanding is a kind of Hibernate After encapsulating the database , You can call the corresponding database operation statement HQL, and MyBatis It uses the original database operation statement .
  2. be based on 1 The reason in , be Hibernate Optimization is relatively MyBatis More difficult .
  3. MyBatis Getting started faster , and Hibernate It's relatively difficult to master .
  4. For advanced queries ,Mybatis It needs to be written manually SQL sentence , as well as ResultMap. and Hibernate There is a good mapping mechanism , Developers don't need to care SQL Generation and result mapping of , You can focus more on business processes .
  5. Hibernate Database portability is good ,MyBatis Database portability is not good , Different databases require different writes SQL.

Summary

summary :SSH Although I feel very heavy , But for understanding MVC Model even IOC It's not bad , It's quite suitable for practicing , however SSM It makes people feel fast , No matter for OOP Or face AOP Programming , It gives people a transparent pleasure .

Recent hot article recommends :

1.1,000+ Avenue Java Arrangement of interview questions and answers (2022 The latest version )

2. Explode !Java Xie Cheng is coming ...

3.Spring Boot 2.x course , It's too complete !

4.20w Programmer red envelope cover , Get it quickly ...

5.《Java Development Manual ( Song Mountain version )》 The latest release , Download it quickly !

I think it's good , Don't forget to like it + Forward !

原网站

版权声明
本文为[Java technology stack]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202220507031478.html