Home

interfaceoriented

Interfaceoriented is a software design approach that emphasizes building software around explicit interfaces that define contracts for behavior and service access, rather than around concrete implementations. In this style, components depend on abstract interfaces, which allows different implementations to be substituted without changing the dependent code. The approach is closely related to interface-based programming and is compatible with dependency inversion and the principle of programming to interfaces.

Core principles include small, cohesive interfaces that express specific capabilities, explicit separation of interface from implementation,

Benefits include improved modularity, easier unit testing with mocks, and greater flexibility to swap implementations or

and
the
use
of
dependency
injection
or
composition
to
assemble
systems.
Interfaces
act
as
contracts
that
specify
what
a
component
can
do,
while
concrete
types
provide
the
details
of
how
it
does
it.
Languages
with
interface
constructs,
such
as
Java,
C#,
and
Go,
provide
idioms
for
interface-oriented
design:
in
Go,
for
example,
a
type
satisfies
an
interface
implicitly
by
implementing
its
methods;
in
Java
or
C#,
classes
declare
interface
implementation
and
can
be
substituted
by
any
class
that
implements
the
same
interface.
mock
dependencies.
Drawbacks
can
include
interface
proliferation,
potential
over-abstraction,
and
added
complexity
in
system
design.
Interfaceoriented
design
is
often
used
alongside
dependency
injection,
service-oriented
architectures,
and,
more
broadly,
SOLID
principles
to
produce
decoupled,
maintainable
systems.