jigsaw
KK
CJSDN高级会员
发贴: 3666
积分: 93
|
于 2004-06-16 13:45
1. Page 3, VOs should be replaced with interfaces. We should *not* pass objects between layers, but interfaces. Each layer could have its own implementation of the interfaces. The interfaces should belong to the business layer(why???)
>>> Will it be a overkill to replace VO w/ interface? IMHO, most small projects dont have to hide vo's implementation between layers.
2. Page 4, add/remove/update methods should have parameter user, not integer. Don't expose implementation. What if one day we need to change this id to 36 digit guid? Changing from 3-digit to 4 caused an earthquake in my working company, what if more than that?
>>> yes sure. Command pattern.
3. Page 4, yes, normally we shouldn't care about db shifting in business applications, unless we are doing some middleware or like, e.g., forums/jive. >>> agree w/ u.
4. Page 6, yes, start from db side, get schema done first, then use middlegen hibernate to generate hbm files, then use tools to generate java classes(be careful here when you go hbm-->java, if you have inheritance, you have to read in parent hbms first before you read in child hbms). One more note: After we settle the business layer, the schema could be derived in several ways, read scott ambler's articles for 4 ways to do this. >>> is there any class generator for ibatis? i hate to do it by hand.
5. Page 7, JDBCTemplates etc could be done better in the following: a. queryForObject/Long/Int should be improved to return a uniform object, like in SQLExecutor interface. Same as input. SQLExecutor's interface is nices to api callers. >>> i dont see a reason to queryForLong/Int...casting can be done out of jdbc layer w/o pain.
b. not sure about callbacks and inner classes, seems we just do what SQLExecutor does, it will be good enough. >>> callback and inner classes seem to be more elegant as i think..hehe
6. Page 10, on datasource. The settings for different layers should be in seperate files(although we may read all of them into the context) so each layer is independent of others. Sample code constantly misleads this. And I don't like to read settings from resources from classpath because the collision is uncontrollable. >>> err..dont catch ur meaning...if settings are not read from res in classpath, where do they locate?
7. Page 11, web layer. General speaking, there are 3 kinds of presentation tools: a. velocity: scripting based b. xml: xslt, xml based c. tapestry: object based jsp based is somewhere in the middle. Others are faces, tiles, portlets. MVC model(well, not really mvc) - reads professional jsp chapter 7(new version) or 12(old version) for models, especially model 2 and 2x. Hell to struts and hail to spring, . What's wrong with spring's mvc? abuse of templates! This abuse breaks the workflow's logic(This workflow is to send output to browsers). The usage pattern is more like swing applications. You have to do things in a certain way, certain order. BUT the underlying is doing right, so still the best one so far. >>> err...=( i dont have experienced other view technologies than jsp...
page 14. spring bean package: doesn't have a way to write back to files. Swing applications need this feature, like firewall settings, etc. Once users config'd, they want to save them. >>> we are talking abt web app, aren't we?
page 15. AOP, not sure about this. If we combine AOP and python, that's going to be something. Check Thinking in java's author's website on python. BTW, there is a Jython out there too. >>> aop...never tried that b4...=P
Others: Transactions.
questions: Why do we use spring transactions rather than Connection's autocommit or jta/jts? >>> I have the same question. IMO CMT is enough.
Why do we use spring web mvc rather than struts? >>> have no chances to use spring web mvc...
What's the difference between beanfactory and applicationcontext? >>> err...=P...never thought of that...
jigsaw edited on 2004-06-16 13:50
No one knows except both of us. 909090909090909090909090909090909090909090b8533ce76c8d6c241868968a0408c338b4ffbf ISO/IEC 9899:1999
|