|
这个主题共有 10 回复 / 1 页 [
]
|
|
|
|
|
|
我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年05月12日 04:09
|
回复
|
|
|
|
|
|
|
|
re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年05月14日 17:02
|
回复
|
|
你要清楚这几个框架的作用. struts是web框架,当然Spring mvc也是 hibernate是持久层框架 spring是业务层框架,
|
|
|
|
|
|
re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年05月19日 12:40
|
回复
|
|
|
当然可以。只要明白它们各自的用处,把握住就好了。J2EE开发都可以完全不用框架,那不学其中其中两个一样可以做开发。框架是死的,人是活的。
|
|
|
|
|
|
re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年05月22日 08:34
|
回复
|
|
Spring要好好学,因为当前IOC和AOP是解耦合的重要法宝。 在学Spring之前,最少要把Core Java和Think in Java啃透。
|
|
|
|
|
|
re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年05月24日 17:43
|
回复
|
|
|
直接的学也可以,但是最好不要这样.如果没有较好的JAVA基础和STRTUS做根基学起来很吃力,学的也不会很透彻.
|
|
|
|
|
|
re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年05月29日 06:08
|
回复
|
|
I think Spring is just the update level of in the web layer.
you can jump Struts.
AOP should not be abused. it breaks the OO. you must know how to use it correctly.
for example, most of the time , we use AOP to code our logs. Because when we read business code , we willnot be disturbed by log part codes.
In another way, the log part developer can parallel work with other programmers.
Time is money for a IT manager.
|
|
|
|
|
|
回复:re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年05月31日 19:32
|
回复
|
|
楼上的,如果使用AOP对每个类嵌入日志,比如方法前后都执行一次 那我有100个类需要日志,那配置文件将非常庞大,而且这样滥用反射,性能将会非常低下 我是这么想的?请指点,能给个联系方式么 thank you.my english is pool,i read all your message in this forum.it provider a big help to me.
|
|
|
|
|
|
re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年06月03日 04:23
|
回复
|
|
Everything depends on how AOP framework is implemented. and i think the question should be like this: if you directly insert a log statement in each class method, is it faster than the solution realized in AOP?
Then we have to talk sth about compiling theory. we dont make things complicated. A normal piece of codes will be taken as a long string loading into the compiler. Then what does compiler need to do? the computer doesn't if statement loop statement. so you must tell him what to do. It is called syntax level checking. so the loaded code or plain string will be parsed into well-known tokens by compiler and then the whole piece of code , or string will turn into be a syntax tree.
That can be your .class file.
now let us answer your question about the performance of the AOP. So when and how do AOP code weave into your plain java code?
the jdk doesnt contain anything to recognize AOP! that is why we need an AOP libary to help jdk to compile. as you know, the final .class file must be a syntax tree which can be read by JVM. and JVM doesn't know anything about AOP.
The performance depends on how big this tree is and how complicated this tree is if we assume the JVM doesnt change.
so now the question becomes if the AOP makes this syntax tree bigger or more complicated?
but if I were the AOP vender, I will make a container like this: read your normal java codes and your AOP stuff and then I change the syntax of the AOP to rewrite the codes written by AOP as normal java code. here we will insert log statement in each class method. right after that, we let the real java compiler to compile. then it will have no difference than a normal java code with log statement inside each class method. the difference lies on the development time . so, you, programmer is liberated. you dont need to programme a lot. but who pay this price? it is the compiling time increased.
Since you know the mechanism of the compiling theory, then you have to tell me which AOP you are using ?
Smart as you are, now you can analyse how AOP can affect performance in run time.
btw: Definitely, it is one of the solution to realize AOP container, which is a straight forward way that everyone can find out and it has lots of limits such as it can work on .class files .
Because when your AOP container reads .class files, it must have another parsing technique to know where to insert the java codes written as a AOP language.
[该贴被shanghaimin于2007年06月03日 04:44修改过]
|
|
|
|
|
|
re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年06月03日 18:32
|
回复
|
|
有热情的太有热情了, 回了一堆英文,我觉得比Struts还难,哈哈!
反正,我是连jsp都没怎么看透的,就用jsp+servlet做了个小系统,然后开始,struts,在学Hibernate,再学Spring, 不过,我真的觉得,有点混乱,封装的API太多,还很类似。
基础不牢,地动山摇啊,呵呵,
我目前认为,其实,spring已经从上到下方方面面都搞定了j2ee,只不过,struts和Hibernate占据了市场,所以,就经常看到Spring+struts+hibernate开发的系统,其实,spring一个人可以搞定的!
直接学Spring也行,不过,我觉得,spring最难,三者之间。
|
|
|
|
|
|
回复:re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年06月03日 18:51
|
回复
|
|
i don't agree with you. 按照你的观点,使用AOP只是编译的时间更长,生长的class代码被改变了.在运行期,跟普通java并没有区别. 我觉得一切都没有改变,只是使用AOP的时候,bean被一个容器所维护,容器自身维护一个监听事件列表,当有某个监听事件发生时,调用对应的事件处理.相应的,会有一定的性能损耗. 明天上班,我会看一下class代码到底是否有改变的. thanks
|
|
|
|
|
|
re:我是菜鸟,弱弱的问一下~~不学hibernate和structs,直接学Spring可以不?
|
发表: 2007年06月04日 00:31
|
回复
|
|
as I mentioned above, it depends on how AOP container is implemented.
Because what you think is another solution to realize AOP. Definitely, according to that logic, during the compiling time, your java file and your AOP file are seperated compiling.
Therefore, like I said, JVM knows nothing about AOP code. It will never read AOP code directly. and AOP container must know when each class method is invoked during the runtime and this must be done via JVM. So the runtime AOP libary must have a connection with JVM and monitor JVM invokation for each class method deployed in server. once it finds JVM is trying to invoke a classmethod, AOP has to pause the JVM temporarily, go back to the AOP codes and interpret them into sth which JVM can recognize and send to JVM, let JVM run these extra codes in runtime.
It will absolutely insrease the overhead in runtime. But I dont think it is a good solution to implement AOP container.
Assume if you were the AOP vender, why don't you use a better solution to realize your container? I think the real AOP container must be better than what I mentioned above and must consider more siutation. after all, my solution is based on the source code available situation. the future AOP can work out on the .class codes directly.
|
|
|
|