<s>
In	O
object-oriented	B-Language
programming	I-Language
,	O
"	O
immutable	B-Application
interface	I-Application
"	O
is	O
a	O
pattern	O
for	O
designing	O
an	O
immutable	B-Application
object	I-Application
.	O
</s>
<s>
The	O
immutable	B-Application
interface	I-Application
pattern	O
involves	O
defining	O
a	O
type	O
which	O
does	O
not	O
provide	O
any	O
methods	B-Language
which	O
mutate	O
state	O
.	O
</s>
<s>
Objects	O
which	O
are	O
referenced	O
by	O
that	O
type	O
are	O
not	O
seen	O
to	O
have	O
any	O
mutable	B-Application
state	O
,	O
and	O
appear	O
immutable	B-Application
.	O
</s>
<s>
The	O
class	O
Point2D	O
is	O
mutable	B-Application
:	O
its	O
state	O
can	O
be	O
changed	O
after	O
construction	O
,	O
by	O
invoking	O
either	O
of	O
the	O
setter	O
methods	B-Language
(setX( )	O
or	O
setY( )	O
)	O
.	O
</s>
<s>
An	O
immutable	B-Application
interface	I-Application
for	O
Point2D	O
could	O
be	O
defined	O
as	O
:	O
</s>
<s>
By	O
making	O
Point2D	O
implement	O
ImmutablePoint2D	O
,	O
client	O
code	O
could	O
now	O
reference	O
a	O
type	O
which	O
does	O
not	O
have	O
mutating	O
methods	B-Language
,	O
and	O
thus	O
appears	O
immutable	B-Application
.	O
</s>
<s>
By	O
referencing	O
only	O
the	O
immutable	B-Application
interface	I-Application
,	O
it	O
is	O
not	O
valid	O
to	O
call	O
a	O
method	O
which	O
mutates	O
the	O
state	O
of	O
the	O
concrete	O
object	O
.	O
</s>
<s>
Clearly	O
communicates	O
the	O
immutable	B-Application
intent	O
of	O
the	O
type	O
.	O
</s>
<s>
Unlike	O
types	O
implementing	O
the	O
Immutable	B-Application
Wrapper	O
pattern	O
,	O
does	O
not	O
need	O
to	O
"	O
cancel	O
out	O
"	O
mutating	O
methods	B-Language
by	O
issuing	O
a	O
"	O
No	B-Language
Operation	I-Language
"	O
instruction	O
,	O
or	O
throwing	O
a	O
runtime	O
exception	O
when	O
a	O
mutating	O
method	O
is	O
invoked	O
.	O
</s>
<s>
It	O
is	O
possible	O
for	O
instances	O
referenced	O
by	O
the	O
immutable	B-Application
interface	I-Application
type	O
to	O
be	O
cast	O
to	O
their	O
concrete	O
,	O
mutable	B-Application
type	O
,	O
and	O
have	O
their	O
state	O
mutated	O
.	O
</s>
<s>
Concrete	O
classes	O
have	O
to	O
explicitly	O
declare	O
they	O
implement	O
the	O
immutable	B-Application
interface	I-Application
.	O
</s>
<s>
The	O
object	O
is	O
not	O
really	O
immutable	B-Application
and	O
hence	O
not	O
suitable	O
for	O
use	O
in	O
data	O
structures	O
relying	O
on	O
immutability	B-Application
like	O
hash	O
maps	O
.	O
</s>
<s>
And	O
the	O
object	O
could	O
be	O
modified	O
concurrently	O
from	O
the	O
"	O
mutable	B-Application
side	O
"	O
.	O
</s>
<s>
Some	O
compiler	O
optimizations	O
available	O
for	O
immutable	B-Application
objects	I-Application
might	O
not	O
be	O
available	O
for	O
mutable	B-Application
objects	I-Application
.	O
</s>
<s>
An	O
alternative	O
to	O
the	O
immutable	B-Application
interface	I-Application
pattern	O
is	O
the	O
immutable	B-Application
wrapper	O
pattern	O
.	O
</s>
<s>
Persistent	O
data	O
structures	O
are	O
effectively	O
immutable	B-Application
while	O
allowing	O
modified	O
views	O
of	O
themselves	O
.	O
</s>
