说得更简单直白点就是, java的main function由jython来实现, 达到dependency inject/Inversion of control的效果。 其他部分不变。 Spring framework也能做到, 可是: 1. XML不好读不好写。 2. 更像魔法, 不知道怎么来的。 通过jython, 我们可以更清楚自己在做什么, 也就是zen of python: Explicit is better than implicit. VS Spring framework: Convention over configuration 一句话:造轮子用java,组合轮子用Jython/Jruby/Beanshell...
it's time to update your java knowledge, xml for ioc. lol. Your spring basic is so last decade. My advice to you, dont advise on things you don't know.
【在 n****1 的大作中提到】 : 说得更简单直白点就是, java的main function由jython来实现, 达到dependency : inject/Inversion of control的效果。 其他部分不变。 : Spring framework也能做到, 可是: : 1. XML不好读不好写。 : 2. 更像魔法, 不知道怎么来的。 : 通过jython, 我们可以更清楚自己在做什么, 也就是zen of python: : Explicit is better than implicit. : VS Spring framework: : Convention over configuration : 一句话:造轮子用java,组合轮子用Jython/Jruby/Beanshell...
I know about @Configuration/Bean/Import/DependsOn, which are just sugar to get rid of the XML. So what? Still feels like magic come from nowhere. With dynamic glue code, ppl can implement these magic by themselves, and maybe other much more powerful decorators. Admit it or not, Spring is essentially a bunch of hacking using java reflection and dynamic class loading. Why not using dynamic language to do the hacking in a more systematic and explicit way?
basic
【在 g*****g 的大作中提到】 : it's time to update your java knowledge, xml for ioc. lol. Your spring basic : is so last decade. : My advice to you, dont advise on things you don't know.
你就是没有实际经验,学了几个helloworld,就不知道天高地厚了。DI configuration ,和普通的parameter configuration不同,在我看来就是源码的一部分。99%以上的部 分,无非就是一边声明,另一边自动wire,简单的不能再简单, 需要啥separation of concern. 没有人在产品环境上通过XML去修改DI,因为这个在integration test里是没 测试到的,风险很大。宁可在开发环境里重新build, 过测试,再部署。而这么做用xml 和用annotation没什么不同。这一整套DI都写入了JEE的标准,是spring出来5,6年以 后的事情。一个人的设计错了不奇怪,一整个java社区经过5,6年的实践还把错误的设 计写入标准,你当你真比jcp那帮人懂java? 你真装逼非要separation of concern, 也大可以用spring的java config. 在应用代码 里要避免写reflection是没错,这正是spring一类优秀架构出现的原因,人把肮脏的部 分都写好了,应用开发者就可以避免直接接触reflection,这才是典型的separation of concern. 说到底,这班上乌烟瘴气,就是像你这样的新手,明明对java经验不多,还成天要抛出 自己的牛屄理论来贻笑大方。你别不服气,你觉得自己的想法牛屄,写个框架出来,用 的人多了,直接像Rod Johnson就可以退休了,再来鄙视我不迟。成天停留在自己意淫 的理论上,一行代码都不写,光闹笑话还牛逼哄哄的。
the
【在 n****1 的大作中提到】 : I know about @Configuration/Bean/Import/DependsOn, which are just sugar to : get rid of the XML. So what? Still feels like magic come from nowhere. : With dynamic glue code, ppl can implement these magic by themselves, and : maybe other much more powerful decorators. : Admit it or not, Spring is essentially a bunch of hacking using java : reflection and dynamic class loading. Why not using dynamic language to do : the hacking in a more systematic and explicit way? : : basic
I think we are finally on the same page now. Spring beans can be consumed by Spring IOC Framework, as well as dynamic language. But not at the same time. That is why I stated "In order to be useful, dynamic language need to get rid of Spring IOC at the first place, no matter how good spring IOC is". And at the same time, dynamic language can integrate those 3rd-party, non- bean classes/libraries easily, instead of adding "@"s to others' code. Sometimes you even don't have access to source code of a 3rd-party library, and dynamic language could still provide IOC/AOP without all those subclassing/delegation pattern.