请问jivejdon3的工作组

miaoxikui 07-05-30

我很很想知道您们jivejdon3过程中都用到了哪些框架呀!
仅仅是JF 和STRUTS吗?
持久层没有用什么框架吗?
我用JF 和STRUTS开发的一个下的项目感觉内存用的很吃力呀
tomcat很慢的
是怎么回事呢?

banq
2007-05-31 14:32

持久层可以使用JF的JDBC或自己的JDBC或Hibernate等ORM

性能问题关键需要从领域建模开始,对重要的业务对象使其实现ModelIF接口。

shanghaimin
2007-06-01 03:13

The performance can be optimized in different tier or layer.

for example,

in view layer, if you use javascript or ajax, definitely the performance will go up. Because the business logic has been distributed to each client machine. The client holds the business data and part of the business logic compared to the solution that server has to do all of the business logic alone, should be faster enough.

in web layer, you can set up load balance to distribute requests to clusters but this is normally supported by application server. it is a general solution to parallel your application and optimize your performance.

in business layer, you know what you gonne do and you can design a specific parallel solution for your application. The principle is as follow:
1. find out all the unit task you need to implement your business logic
2. check the sequence of these unit tasks. if they depend on each other, then you dont have luck.
if some tasks are independent from each other, then you can parallel them in different CPUs or different machines.
but Be careful of one point: the limit of your parallel solution is the communication among all these servers.
So finally if you finish all your unit tasks in different machines , they have to gather to one machine and continue their sequential tasks and it may lead to a situation that some results
have to wait for the other slow calculations.
in short, when you use parallel programming, you have to be clear that performance cannot be optimized endless. sometimes 1+1>2 which means u have more cpus but the performance is reduced.

3. in persistent layer, the best way is to let DB handle everything and optimize your SQL to fit for that DB SQL parser.
Because lots of DB interpret SQL ability are different. please check the reference and benchmark them.
at least in Oracle, better to call a stored procedure in your java code and let the real sql stay inside the stored procedure.
So that is the fastest way.

shanghaimin
2007-06-01 03:17

In my personal opinion, dont use hibernate.
Use DAO. with DAO, you can control the SQL in maxim performance while, in the other hand, you do the orm yourself. So you dont lose the OO design. you still can have a DAOManager to concentrate all the persistent layer tasks in one Class. and the layer is still clearly separated.