to Banq 关于你的第八章的一些疑问

07-06-01 X.Underset
378页

8.5.1 DAO模式

中提到:"不推荐在EJB的Session Bean中直接使用JDBC调用语句,而是通过DAO模式来间接地访问数据源。"

能不能说说为什么?

是因为藕和方面的考虑还是性能方面的

还有就是那个批量框架:我个人十分喜欢你所设计的这个框架;但有个小问题:

您是先找出所有符和条件的记录然后再在记录中选出十条来返回;

如果记录有上千万条或是更多的话就算是只返回记录的ID,在那返回所有记录的一段时间速度肯定会受影响;就这方面Banq有何想法?

shanghaimin
2007-06-02 20:05
I prefer to explain that in an engineering thought.

how to make IT project successful?

1. easy to test to make your application robust

so what does that mean easy?

you write a "main" and then you know if your piece of code is correct or not.

so EJB is definitely not making you easy to test business logic. because you must package them,deploy them,connect to DB etc. then make a simple test. is it easy?

conclusion: each fancy technology in java should used as a facade if that cannot bring a simple test.

2. do u know the layer theory?

one abstract layer more can trade off more generosity in application.

check JVM, why can windows, linux,unix can serve java application. because jvm is the layer between them. that is why java partially slow.

check ODBC and JDBC, why database can connect to different OS? same reason.

check google, why they bought mozilla firefox, because that creates one layer more between all server side applications created by google and the MS monopolied OS? that is to say, if MSSOFT tries to update windows, the google just needs to update their browser APIs and all the rest of the applications dont need a single touch.

3. OO design is not ur project purpose. it is one of the way to well solve some problems during ur project. but mainly it is client and business-oriented, more in the macro level. because the client requirement changes all the time, that is why application needs to be flexible and dynamic.

but it doesnt create sth new or some core technology.

猜你喜欢