interface method with readonly (const) parameters, not final
From: HK (pifpafpuf_at_gmx.de)
Date: 02/27/05
- Next message: dar7yl: "Re: Design question"
- Previous message: Aquila Deus: "Recursive Relationship with Hibernate?"
- Next in thread: Boudewijn Dijkstra: "Re: interface method with readonly (const) parameters, not final"
- Reply: Boudewijn Dijkstra: "Re: interface method with readonly (const) parameters, not final"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Feb 2005 03:14:19 -0800
What I would like to do is this:
public interface Boo {
Boo mergeWith(Boo const other) const;
}
The intention would be to force an implementation
to not modify any of `this' or `other', but return either
one unchanged or create a freshly allocated object.
I read
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d658a6a2f00743de?tvc=2&q=readonly+method+parameters+final+
and
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4211070
but most of the discussion and proposed workarounds
relate to concrete implemented methods. Any ideas of how to
come at least close to the above other than by calling
the method only ever with copies of the original
things or write blurb in *BOLD* into the spec?
Thanks,
Harald.
- Next message: dar7yl: "Re: Design question"
- Previous message: Aquila Deus: "Recursive Relationship with Hibernate?"
- Next in thread: Boudewijn Dijkstra: "Re: interface method with readonly (const) parameters, not final"
- Reply: Boudewijn Dijkstra: "Re: interface method with readonly (const) parameters, not final"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|