On Fri, 16 Sep 2005 06:47, Tore Halset wrote:
> On Sep 15, 2005, at 22:30, Andrus Adamchik wrote:
> > What I am still unclear is a very simple case below. Consider this
> > method called from UI (web or Swing), not on commit:
> >
> > public String getUrl() {
> > return getPart1() + getPart2() + getPart3();
> > }
> >
> > I am trying to avoid duplication of this code between client and
> > server classes. I guess inheritance of server objects from client
> > objects would be an option...
>
> Ok, I see. The server class could contain some logic that should not
> be exposed on the client. Like dependant on other jars, or some
> secret biz logic. So inheritance of server classes are not always a
> good option.
>
> I think code duplication is ok in that case :/
I think code duplication is ok.
What the above function describes is a way to display data. As such, the code
doesn't even necessarily make sense to exist on the server since it (in a
server/client situation) would not typically deal with displaying any data.
The exception here could be running/creating reports, exports and printing. I
would still argue that this sort of functionality should be implemented
client side.
-- - Marek W-- 2b | !2b Send instant messages to your online friends http://au.messenger.yahoo.com
This archive was generated by hypermail 2.0.0 : Thu Sep 15 2005 - 19:29:56 EDT