由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - design review
相关主题
ant dependency analyzer请问一个问题
Which Web service is better EJB or RPC搞不懂为什么hibernate为什么这么流行?
run servlet from command line?[合集] Business and Persistence layers separation.
问一个很基本很基本很基本的API问题spring/hibernate/ajax/web 2.0/bpel books
大家都是搞技术的Anyone wants to talk about web frameworks?
J2EE和未来工作问题讨论一下web framework吧
有多少人对annotation这个东西不满,请举手!!有想学JSF的同行么? (确切地说 JSF+Spring+Hibernate)
webservices products中文书真是没法看
相关话题的讨论汇总
话题: url话题: method话题: spring话题: products话题: design
进入Java版参与讨论
1 (共1页)
s******e
发帖数: 493
1
requirements: read only data. Database scheme is a little complicated(maybe
not necessary, but I have no control). several similar products, each have
some subsets. The front looks similar(the data is shown in a table with
different headers) but the results come from different tables.
Technology chosen: jsp/javascript as the front, spring mvc with dao and
ibatis sql map as middle tier.
One thing that i am not quite comfortable with my design is that i tightly
couple url pattern with my POJO logi
m******t
发帖数: 2416
2
What kind of "coupling" are we talking about here? The part-of-the-url-is-
the-POJO-method-name kind of coupling would be very bad.
s******e
发帖数: 493
3
Yeah. It is just like waht u said. This makes me very uneasy. Any suggetion
for improvement. I would show the flow in details as follows:
A controller <---(inject) Helper interface (with one single method of
service(Object) I pass the httpServletRequest for further processing. An
abstract helper class containing the method invokation code after analyzing
url. For example, ../Home.do(almost all products have this url) will cause
serviceHome method to be called. In the serviceHome, the appropriate
h******a
发帖数: 46
4
I would first do more bussiness requirement rearch, something like what's
the relationship of the 7 products? any business similarities? how is client
going to use them? who is going to maintain this project? etc. then you
might have better ideas of how to implement it. btw, you can always refactor
it in the future.

suggetion
analyzing
products

【在 s******e 的大作中提到】
: Yeah. It is just like waht u said. This makes me very uneasy. Any suggetion
: for improvement. I would show the flow in details as follows:
: A controller <---(inject) Helper interface (with one single method of
: service(Object) I pass the httpServletRequest for further processing. An
: abstract helper class containing the method invokation code after analyzing
: url. For example, ../Home.do(almost all products have this url) will cause
: serviceHome method to be called. In the serviceHome, the appropriate

m******t
发帖数: 2416
5
Did you look at Spring's MultiActionController and one of the
AbstractMethodNameResolver subclasses?

suggetion
analyzing
products

【在 s******e 的大作中提到】
: Yeah. It is just like waht u said. This makes me very uneasy. Any suggetion
: for improvement. I would show the flow in details as follows:
: A controller <---(inject) Helper interface (with one single method of
: service(Object) I pass the httpServletRequest for further processing. An
: abstract helper class containing the method invokation code after analyzing
: url. For example, ../Home.do(almost all products have this url) will cause
: serviceHome method to be called. In the serviceHome, the appropriate

s******e
发帖数: 493
6
Yeah I did. Actually I believe that finally we reach my real problem.
I thought to use mutilActionController and PropertiesMethodNameResolver. But
the problem is that I need to define a method name resolver for each
product even the url patterns are similar and the method names are the same.
for example, i have urls: ../df/home.do and ../ma/home.do(I use the prefix
to distinguish url patterns, so I do not want too many url pattern names,
which is also bad for maintainence), I need to define two
m******t
发帖数: 2416
7

will
Well finding the controller and method resolving are two separate steps in
standard Spring MVC anyway, isn't it? I don't see why it can't be done with
any UrlMapping plus a MethodNameResolver. I guess I'm still not getting
your whole picture.
Or just write your own MethodNameResolver maybe? It's just one method to
implement, really. 8-)

【在 s******e 的大作中提到】
: Yeah I did. Actually I believe that finally we reach my real problem.
: I thought to use mutilActionController and PropertiesMethodNameResolver. But
: the problem is that I need to define a method name resolver for each
: product even the url patterns are similar and the method names are the same.
: for example, i have urls: ../df/home.do and ../ma/home.do(I use the prefix
: to distinguish url patterns, so I do not want too many url pattern names,
: which is also bad for maintainence), I need to define two

g*****g
发帖数: 34805
8
Spring doesn't provide you everything. But it does provide
a flexibile framework that you can extend and implement your own.
For his design need, I think writing his own MethodNameResolver
would be the best approach.
In our Webmail project, every user belongs to some enterprise,
and every enterprise will have its own branding files. A
home grown LocaleResolver and MessageSource will work like a charm.

with

【在 m******t 的大作中提到】
:
: will
: Well finding the controller and method resolving are two separate steps in
: standard Spring MVC anyway, isn't it? I don't see why it can't be done with
: any UrlMapping plus a MethodNameResolver. I guess I'm still not getting
: your whole picture.
: Or just write your own MethodNameResolver maybe? It's just one method to
: implement, really. 8-)

s******e
发帖数: 493
9
Sorry for late response. I guess that might be my best solution. thx for
both of u to discuss with me.
1 (共1页)
进入Java版参与讨论
相关主题
中文书真是没法看大家都是搞技术的
怎么把servlet publish成web servicesJ2EE和未来工作问题
j2ee without EJB有多少人对annotation这个东西不满,请举手!!
simple java questionwebservices products
ant dependency analyzer请问一个问题
Which Web service is better EJB or RPC搞不懂为什么hibernate为什么这么流行?
run servlet from command line?[合集] Business and Persistence layers separation.
问一个很基本很基本很基本的API问题spring/hibernate/ajax/web 2.0/bpel books
相关话题的讨论汇总
话题: url话题: method话题: spring话题: products话题: design