由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 看Spring真是头大
相关主题
j2ee without EJBWhat do you think about AOP?
新手学习java spring, hibernate或者struts的问题spring transaction的问题
这样理解spring的AOPHow to intercept a method call
讨论spring这么多,还没有说到点子上的。spring AOP question
spring到底有什么好处?AOP 中的 self-invocation 问题
不明白Spring Framework很正常怎么能学成J2EE的全能
java的东西好多access java parent class protected variable question
有多少人对annotation这个东西不满,请举手!!c++熟手如何学习Java直到能够参与开发企业级应用?
相关话题的讨论汇总
话题: spring话题: ioc话题: so话题: config话题: aspectj
进入Java版参与讨论
1 (共1页)
r*****s
发帖数: 985
1
我觉得Spring的问题就是选择太多,
你看看搞个AOP你可以用@AspectJ or Schema定义,
可以用applicationContext or programatically,
然后applicationContext还可以这样或者那样,
又想兼容aspectJ又要自己搞一套
我看迟早大家又会说:这玩意儿太复杂,我们换个简单的。
g*****g
发帖数: 34805
2
You can stick to EJB3 style. And spring should be compatible
for that.

【在 r*****s 的大作中提到】
: 我觉得Spring的问题就是选择太多,
: 你看看搞个AOP你可以用@AspectJ or Schema定义,
: 可以用applicationContext or programatically,
: 然后applicationContext还可以这样或者那样,
: 又想兼容aspectJ又要自己搞一套
: 我看迟早大家又会说:这玩意儿太复杂,我们换个简单的。

r*****s
发帖数: 985
3
关键是personally i don't like too much config.
not tracable and hard to debug
配上bad document (通常programmer写的都是),
一件简单的事情都不知道怎么办了。
你看for mixing aspect types chapter 7.5
用@AspectJ + ,
就没个像样的例子,
config就像在搞permutation,
选择又太多,
而且还要等到server起来了才能检验work不work。
当然,
我检讨,
我今天有点心浮气躁。

【在 g*****g 的大作中提到】
: You can stick to EJB3 style. And spring should be compatible
: for that.

a***n
发帖数: 584
4
Sorry to reply in English.
Regarding tracing and debug, I once had a similar question. But Spring
claims to have 80% code test coverage (if I remember correctly). Also, their
test code and original source code are opened. So, Spring requires the
users to trust them.
Also, AOP is hard to debug in general.
I do agree that Spring sometimes make a simple thing complicated, but also
make a complex problem simple. :-)
Spring's market strategy seems to support all best practices. I am sure if
they have any hidden agenda or not.
T*o
发帖数: 363
5
BTW, As a learner of enterprise Java, may I skip EJB3 and go for Spring
directly?
My knowledge in enterprise Java still stays on web layer (JSP, Servelt + SE
libs), need to extend it recently.

【在 g*****g 的大作中提到】
: You can stick to EJB3 style. And spring should be compatible
: for that.

b******y
发帖数: 9224
6
It seems to me that spring framework is "simpler" than some other java
framework, but not so simple ;-)
s*********n
发帖数: 237
7
Spring is big and grows fast. It has quite some history, so it covers lots of things, lots of them are probably
not useful for your work. You do not have to use/learn everything. What is really powerful is the idea IoC. So
I would suggest to read about the basic IoC first and then proceeds to where really is pertinent to you.
Also, Spring's documentation turns to be only useful for reference instead of learning from scratch. So I would
suggest to find read books instead of their docs although they might be a bit out-of-date.
Some options:
Spring in Action: a little out-of-date, still about spring 2 as of now Mar, 2011, not much annotation, good for
the basics though.
Spring Recipes: A Problem-Solution Approach: more up-to-date spring 2.5. Fairly good after you know the
basic things in spring.
Rod Johnson's book: the inventer of spring. Good to understand the principle. But quite out-of-date in terms
of specific things.
r*****s
发帖数: 985
8
也不是learning from scratch
IoC/DJ也不是问题
就是本来IoC/DJ就不是个复杂的东西,
不就是把programming postponed to config吗?
不就是increase some level of indirection & “flexibility”吗?
我是说spring的选择太多,
照顾的太多,
又要兼容,
又要new feature。
我有一阵子弄RoR,
就觉得很舒服,
你就不用选,
就那么一套。
hello world的程序当然好写,
现实中跟已有的application配起来就不那么简单了,
特别是如果这个系统有很多人一起在弄,
spring的很多东西都是hiddenly/vaguely configured somewhere,
谁知道你的config跟别人的config是不是overlapped/conflicted,
结果就是可能一个简单的Bean或Aspect就要弄半天。
我想主要的问题是这个config也是一种programming
本来programming有很多best practices
其实是适用于config中的,
但是没有很好的被observed。
你说的那些书,
一旦过时一点点,
在现实中就没有意义了,
了解一下IoC/DJ当小说看看还差不多,
只能看current version的online document
不过当然还是很谢谢你的推荐。

lots of things, lots of them are probably
What is really powerful is the idea IoC. So
where really is pertinent to you.
of learning from scratch. So I would
bit out-of-date.
, 2011, not much annotation, good for
Fairly good after you know the

【在 s*********n 的大作中提到】
: Spring is big and grows fast. It has quite some history, so it covers lots of things, lots of them are probably
: not useful for your work. You do not have to use/learn everything. What is really powerful is the idea IoC. So
: I would suggest to read about the basic IoC first and then proceeds to where really is pertinent to you.
: Also, Spring's documentation turns to be only useful for reference instead of learning from scratch. So I would
: suggest to find read books instead of their docs although they might be a bit out-of-date.
: Some options:
: Spring in Action: a little out-of-date, still about spring 2 as of now Mar, 2011, not much annotation, good for
: the basics though.
: Spring Recipes: A Problem-Solution Approach: more up-to-date spring 2.5. Fairly good after you know the
: basic things in spring.

N******7
发帖数: 1297
9
我个人以为这还是因为对Spring没了解逶。就象总有新手抱怨说程序的入口都找不到是因为对OO还没了解逶一样。我认为选择多不是坏事,只怕做的多了反面都做不好,bug多,但Spring的这方面还是不错。

【在 r*****s 的大作中提到】
: 也不是learning from scratch
: IoC/DJ也不是问题
: 就是本来IoC/DJ就不是个复杂的东西,
: 不就是把programming postponed to config吗?
: 不就是increase some level of indirection & “flexibility”吗?
: 我是说spring的选择太多,
: 照顾的太多,
: 又要兼容,
: 又要new feature。
: 我有一阵子弄RoR,

a****i
发帖数: 1182
10

我觉得这两条你没说到点子上
为什么它要先定义interface不直接用class?
选择多没关系,你搞清楚其中之一就可以了

【在 r*****s 的大作中提到】
: 也不是learning from scratch
: IoC/DJ也不是问题
: 就是本来IoC/DJ就不是个复杂的东西,
: 不就是把programming postponed to config吗?
: 不就是increase some level of indirection & “flexibility”吗?
: 我是说spring的选择太多,
: 照顾的太多,
: 又要兼容,
: 又要new feature。
: 我有一阵子弄RoR,

相关主题
不明白Spring Framework很正常What do you think about AOP?
java的东西好多spring transaction的问题
有多少人对annotation这个东西不满,请举手!!How to intercept a method call
进入Java版参与讨论
r*****s
发帖数: 985
11
您的意思就是indirection/abstration is necessary,
但是不是说我们一写code就总要定义interface是不?
DJ/IoC当然是必要的,
pico啊啥的就做到了,
spring本来就是把app server的功能打散了,
你们自己组装吧,
但是组装(config)不是活吗?
什么地方需要组装是需要商榷的,
如果你给了太多选择,
实现的人又不能体会要领,
就会不必要的增加困难。
lss上的批评的我当然接受,
我需要继续努力,
搞清各个零件的关系,
但是不代表我们就要“存在即合理”式的逆来顺受,
就不能对现有的东西发表意见。
你也可以说咱不用汇编写distributed system程序
只是咱对汇编不熟而已。

【在 a****i 的大作中提到】
:
: 我觉得这两条你没说到点子上
: 为什么它要先定义interface不直接用class?
: 选择多没关系,你搞清楚其中之一就可以了

s*********n
发帖数: 237
12
Personally, I feel that it is the responsibility of the lead programmer/
architecturer to choose which specific techniques to use. The other
developers follow (maybe suggest as well) and get familiar with that set of
chosen techniques. As the decider, you need to know the subtlety and trade
-off to decide them and that calls experience and a bit of vision, sometimes
maybe just a little gut-feeling as well. It is bad if the tool itself is
badly implemented, which is not the case for spring most of the time. But
more choices itself seems not a bad thing mostly. I would suggest to be
just familiar with the part of the spring you really need.
You can also say java is too large with too many options if you include
every pieces of well-know libraries into consideration. But that is more of
the benefit instead of problem.
g*****g
发帖数: 34805
13
Spring is OK, web framework is truly an issue. The communities have
too many frameworks on web layer and none of them get popular enough
like Struts of old days.

of
trade
sometimes
is
But

【在 s*********n 的大作中提到】
: Personally, I feel that it is the responsibility of the lead programmer/
: architecturer to choose which specific techniques to use. The other
: developers follow (maybe suggest as well) and get familiar with that set of
: chosen techniques. As the decider, you need to know the subtlety and trade
: -off to decide them and that calls experience and a bit of vision, sometimes
: maybe just a little gut-feeling as well. It is bad if the tool itself is
: badly implemented, which is not the case for spring most of the time. But
: more choices itself seems not a bad thing mostly. I would suggest to be
: just familiar with the part of the spring you really need.
: You can also say java is too large with too many options if you include

z***e
发帖数: 5393
14
同感,很烦java的一点就是要在各种configuration xml上花费大量时间。
而且spring ioc就是个用reflection来付直的工具,说得那个复杂哦。。

【在 r*****s 的大作中提到】
: 关键是personally i don't like too much config.
: not tracable and hard to debug
: 配上bad document (通常programmer写的都是),
: 一件简单的事情都不知道怎么办了。
: 你看for mixing aspect types chapter 7.5
: 用@AspectJ + ,
: 就没个像样的例子,
: config就像在搞permutation,
: 选择又太多,
: 而且还要等到server起来了才能检验work不work。

g*****g
发帖数: 34805
15
如果不太复杂的话,用用annotation够了,远没有xml那么繁琐。
我老一直认为,spring xml大部分的内容已经超出了configuration
的领域,用xml并没有啥好处。所以spring最新加入programmatic
configuration也是这个原因。

【在 z***e 的大作中提到】
: 同感,很烦java的一点就是要在各种configuration xml上花费大量时间。
: 而且spring ioc就是个用reflection来付直的工具,说得那个复杂哦。。

1 (共1页)
进入Java版参与讨论
相关主题
c++熟手如何学习Java直到能够参与开发企业级应用?spring到底有什么好处?
关于struts和spring的几个疑问不明白Spring Framework很正常
j2ee现在流行什么?java的东西好多
Spring 工作机会好象不多啊!有多少人对annotation这个东西不满,请举手!!
j2ee without EJBWhat do you think about AOP?
新手学习java spring, hibernate或者struts的问题spring transaction的问题
这样理解spring的AOPHow to intercept a method call
讨论spring这么多,还没有说到点子上的。spring AOP question
相关话题的讨论汇总
话题: spring话题: ioc话题: so话题: config话题: aspectj