为什么老外不愿意用MyBatis

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_33963594/article/details/86753259
专注于Java领域优质技术号,欢迎关注

作者:codeasy

老外用MyBatis吗

昨天我在我在知乎看到了一张比较Hibernate和MyBatis使用情况的图,顺手发了条朋友圈:

为什么老外不愿意用MyBatis
Hibernate vs MyBatis ,谁能告诉我什么样的国情导致了这么大的差异?

结果有人质疑,有人感叹。

我开始没有想到会有人质疑这个结果,在我的直觉里,确实国外使用MyBatis的人很少(在国外的网站上很少看到MyBatis的文章,但JPA/Hibernate的文章经常看到)。所以今天早上我用google的trends验证了一下,上面的以及下面的这些比较图,都可以访问 https://trends.google.com/trends/explore?q=%2Fm%2F04t80p,MyBatis 来看到。

从下面这个对比来看,MyBatis的关注主要集中在中日韩。

为什么老外不愿意用MyBatis

从全球的的比例来看,是这样的:

为什么老外不愿意用MyBatis

上面是基于google查询的数据计算出来的,如果基于youtube,那结果是这样的:

为什么老外不愿意用MyBatis

从以上的结果来看,在国外,准确地说,在中日韩之外的大部分地区,JPA/Hibernate完胜MyBatis,但在国内却完全相反,But Why?

老外为什么不用MyBatis

为什么会这样呢?我也不知道。一些朋友发表了自己的想法:

为什么老外不愿意用MyBatis

回复基本上分两种:

  • 青年程序员都在质疑这个图的可信度
  • 中老年程序员都在感叹国外其实更注重开发效率和面向对象的分析和设计

有个朋友说的非常好:

窃以为,唯独神州大量使用Mybatis,主要看重它不强化业务建模地搞表。造成的后果是,宁可自己写SQL也不意义花力气使用OOAD思维方式梳理业务并建模。而hibernate是OOAD建模后的自然延伸

好吧,下面是我个人的观点:

  • 确实,和对OOAD的重视有关,我在做DDD战术落地的时候,用MyBatis非常蹩脚,用JPA/Hibernate会好很多。
  • JPA/Hibernate比较复杂,团队中要有人Hold住它,否则及其容易踩坑;另外,真要使用,建议使用它的一个功能子集,不要所有功能都用。也可以尝试使用更简单EBean ORM。
  • JPA/Hibernate对分库分表的支持有一下坑。虽然,使用Shareding-JDBC或MyCat等技术,可以不关心分库分表,但是,JPA/Hibernate在某些情况下(比如加载子集合的时候)可能会不带分区键。国外分库分表的少,国内几乎是标配。
  • 国内做互联网的Java程序很多都是拷贝阿里的,阿里一开始用例iBatis(日本韩国是怎么回事呢)。大量的老系统都是基于iBatis/MyBatis的,市场上对MyBatis熟悉的人才更多,招聘和培训更容易,有的青年程序员以为“MyBatis早已统一全球了”就是一个很好的证明。

还有别的原因吗?大家可以补充。

展开阅读全文

为什么公司不愿意提供技术指导?

09-16

目前只学习了3个月的C++. rn我目前只有这样的基础:C++基本语法,回调函数机制 rnAPI调用约定,windows消息机制(部分)消息太多了 rn一下子也了解不完. rn调试程序,下断 跟踪。 rnrn自己 只写过21点游戏程序. rn单个程序最大代码量是1400行左右. rnrnrn于是我找了一家公司的人事,去谈。 rntraso 16:45:34 rn你好 rnrn︶ㄣ无氧呼吸 16:45:39 rn? rntraso 16:46:00 rn如果我要成为游戏客户端程序员的话 rnrntraso 16:46:04 rn我还需要学些什么? rnrntraso 16:46:15 rn我给你说下我目前的情况 rnrn︶ㄣ无氧呼吸 16:47:37 rn好的 rntraso 16:48:51 rn我目前只有这样的基础:C++基本语法,回调函数机制 rnAPI调用约定,windows消息机制(部分)消息太多了 rn一下子也了解不完. rn调试程序,下断 跟踪。 rn请问如果我要学习OGRE还需要哪些基础? rnrntraso 16:49:06 rn自己 只写过21点游戏程序 rnrntraso 16:49:20 rn代码量大概是1400行左右 rnrn︶ㄣ无氧呼吸 16:50:19 rn还需要加强很多方面 rntraso 16:50:38 rn恩? rnrntraso 16:50:41 rn比如说 rnrntraso 16:52:05 rnwindows编程设计中 的关于位图的存储 metaFile部分对于游戏客户端程序是否有用 rnrn︶ㄣ无氧呼吸 16:52:56 rn基本没有 rn︶ㄣ无氧呼吸 16:53:04 rn这个你要问程序,我不是程序 rn︶ㄣ无氧呼吸 16:53:08 rn我只是人事 rntraso 16:53:14 rn恩 那基本有哪些方面的需求 rnrntraso 16:53:15 rn哦 rnrntraso 16:53:21 rn能帮我联系程序方面的么? rnrntraso 16:53:38 rn如果给予我指导了 我合格了就加入你们公司 rnrntraso 16:58:25 rn.................不可以么? rnrn︶ㄣ无氧呼吸 16:59:46 rn== rnrnrn之后就没消息了. rn 论坛

用MSN与老外交流的聊天记录!!!!!!!!!!!!!!!!

10-10

foreigner says:rnhellornforeigner says:rnhus disrnPaul.Lee says:rnhello, who are you?rnforeigner says:rnalex you?rnPaul.Lee says:rnI'm paul.rnPaul.Lee says:rnWhere are you from?rnforeigner says:rnriponrnforeigner says:rnu?rnPaul.Lee says:rnAre't you Chinease?rnforeigner says:rnchinese?rnPaul.Lee says:rnYeah.rnforeigner says:rnnornPaul.Lee says:rnhaha, nice to meet you!rnforeigner says:rn samernPaul.Lee says:rnI'm chinese!rnforeigner says:rn rnPaul.Lee says:rnwhat is means?rnforeigner says:rncoolrnPaul.Lee says:rnMay I ask a question to you?rnforeigner says:rnyeahrnPaul.Lee says:rnwhy do you talk with me, so simple?rnforeigner says:rn i dont know rnPaul.Lee says:rnless than 3 words, every time!Could u tell me why?rnforeigner says:rnnot sure really do you want me to have one this long rnPaul.Lee says:rnCertainly.rnforeigner says:rn what would you like me to talk about?rnPaul.Lee says:rnanything is OKrnPaul.Lee says:rn??rnforeigner says:rnerm why your e-mail address was in the toilets near the bankrnPaul.Lee says:rnjust for e-mail address.rnforeigner says:rn rnPaul.Lee says:rnI'm working, now .what about u?rnforeigner says:rnsat at homernforeigner says:rnwhere do you workrnPaul.Lee says:rnProvince of Guand Dongrnforeigner says:rnwhere?rnPaul.Lee says:rnA province Of China.rnforeigner says:rnso you are in china now?rnPaul.Lee says:rnYes, you are right.rnPaul.Lee says:rnwhat is full name of ripon?rnforeigner says:rnripon that is pretty much it rnPaul.Lee says:rnDo you have been come to China?rnforeigner says:rnno i havntrnPaul.Lee says:rnHow old are u?rnforeigner says:rn18rnPaul.Lee says:rnDo you understand what's means of everyone sentences about me?rnPaul.Lee says:rnDo you understand what's means of every sentences about me?rnforeigner says:rna bitrnPaul.Lee says:rnOh, my god!rnPaul.Lee says:rnI apologize to you for it!rnforeigner says:rnthats why dont you start a conversationrnPaul.Lee says:rnI want to make a friend with UrnPaul.Lee says:rnDon't you?rnforeigner says:rnwhat make friendsrnPaul.Lee says:rnOh,sorry. My English is not perfect!rnPaul.Lee says:rnwhat are you doing?rnforeigner says:rnnothing just sitting at home chatting on msnrnPaul.Lee says:rnRipon is in Wisconsin?rnforeigner says:rnripon in englandrnforeigner says:rnin north yorkshirernPaul.Lee says:rnthat's so.rnforeigner says:rnwell u must know where it is if your e-mail address was in the toilets in riponrnPaul.Lee says:rncould you tell me?rnPaul.Lee says:rnI really don't know the means.rnPaul.Lee says:rnI really don't know what the means.rnforeigner says:rnif you dont know where ripon isrnforeigner says:rnwhy was ur e-mail address in itrnPaul.Lee says:rnProbable the Internet!rnforeigner says:rnno your e-mail was written in a toiletrnforeigner says:rnim just gonna block you if u dont tell me the truthrnPaul.Lee says:rnPlease don't.rnforeigner says:rnwell?rnPaul.Lee says:rntrue, I really don't know. please belive me. In other words, I don't know how can I rnrnexpression.rnforeigner says:rnwhy was ur e-mail address in a toilet in ripon then? please tell me the truthrnPaul.Lee says:rnwell. what do you seen?rnPaul.Lee says:rnabout my e-mail address rnforeigner says:rnin the toilets near the bank i saw paullbm@hotmail.com written on the back of a cubicle doorrnPaul.Lee says:rnha, that's so.rnPaul.Lee says:rndo you know what's means about my e-mail address?rnPaul.Lee says:rnor else?rnforeigner says:rnno i dont what do you meanrnPaul.Lee says:rnwhat else?rnforeigner says:rnthats itrnPaul.Lee says:rnwhat? Please tell me. I will be tell you if I know!rnforeigner says:rnhave you ever been to englandrnPaul.Lee says:rnnever!rnforeigner says:rnwell that cant be truernPaul.Lee says:rnwhy do you think that?rnforeigner says:rnbecause you wrote ur email address in the toiletsrnPaul.Lee says:rntoilets?????rnforeigner says:rnnear the bankrnPaul.Lee says:rnI'm in office, now! I really don't kid you!rnPaul.Lee says:rnIt's absolutely impossible where my e-mail address in the toilets near the bank!!rnforeigner says:rnwell it was there so u must be lieing or someone put ur address there n i doubt thatrnPaul.Lee says:rnmaybe, i think so.rnforeigner says:rnwell im gonna block u n e way coz i dont know urnPaul.Lee says:rnplease don't.rnPaul.Lee says:rnI don't know what my explanation can approve of you.rnforeigner says:rny are you so bothered your in china im in england we dont know each otherrnPaul.Lee says:rnbecause we are in difference country!rnforeigner says:rnyeah so y botherrnPaul.Lee says:rnbut we can make friend with each other.rnforeigner says:rnwhat would be the pointrnPaul.Lee says:rnanything!rnPaul.Lee says:rnI introduce myself to you, at first.rnPaul.Lee says:rnMy name is LBM. "Paul Lee" is my English name, and named by myself!rnforeigner says:rny do i need to know thisrnPaul.Lee says:rnwell, what do you interesting?rnforeigner says:rnim gonna block you now byernPaul.Lee says:rnI want to cry..rnPaul.Lee says:rnI feel sad..rnforeigner says:rny?rnPaul.Lee says:rnI hope make friend with you, but U want to gonna block me.rnforeigner says:rny would you ?rnrnrnrnrnrn===============rnpaul.lee 就是我. 论坛

老外的问题

03-03

最近在搞项目代码评审,是用c开发的。老外有模板,但好多我看不懂,哪为高手能不能帮助解释一下啊。先谢谢了。rnNo. Item Detailsrn1.1 Datarnconsistency 1rnCondition:rnThere are global variables into which multiple tasks write values.rn(Where multiple tasks read values shall be unspecified.)rnNote that multiple write by the initial process can be excluded only if it canrnbe proved that the initial process starts only at the time of turning power onrnand that the process is completely isolated from other tasks.rnrnIt cannot identify which task has written the reflected value to be read. Also,rnif the priority is same for all the tasks and the same task writes/readsrnvalues, the value written by some other task cannot be reflected.rnValidation:rnValidate the following points for all the global variables that satisfy thernconditions.rnrnA: Explain using a timing chart that requirement specifications can bernsatisfied for all timing in whatever timing the written value is reflected tornall the values being read.rnB: If the requirement specifications cannot be satisfied in the validationrnabove, explain the countermeasure for it.rn1.2 Datarnconsistency 2rnCondition:rnThere are global variables that read multiple data at the level different fromrnthe writing task.rnNote that multiple write by the initial process can excluded only if it can bernproved that the initial process starts only at the time of turning power on andrnthat the process is completely isolated from other tasks.rnrnIt cannot identify whether the read value is the value written in previousrncycle or in the same cycle.rnValidation:rnValidate the following points for all the global variables that satisfy therncondition.rnrnA: Extract the global variables where each value to be read should be thernvalue written in the same cycle based on the requirement specification,rnand explain using a timing chart that the requirement specifications canrnbe satisfied for all timing.rnB: If the requirement specifications cannot be satisfied in the validationrnabove, explain the countermeasure for it.rn第一个是说如果有多个任务都写同一个全局变量可能存在风险,但下面的validation 里的A我看不懂,第二个我几乎都看不懂啊 论坛

没有更多推荐了,返回首页