Interface
Term |
Interface |
Aliases |
- |
Identity
-
Term ID:
src/main/doxsite/glossary/object-foundation/interface.dox -
English label: Interface
-
Japanese label: インターフェース
-
Category: Object Foundation
-
Status: normative
-
Definition authority: SimpleModeling BoK
DEFINITION
An Interface is a named object-side Type contract that specifies Operations, Responsibilities, and Protocols offered externally by an Object without fixing its internal state or implementation. A Class may provide or realize one or more Interfaces.
UML
In UML 2.5.1, an Interface is a Classifier and therefore a Type that specifies a coherent set of externally observable Services. A BehavioredClassifier such as a Class may realize the contract through an InterfaceRealization. SimpleModeling adopts this basic relationship.
Common Usage
Programming-language interfaces and traits have different capabilities across languages, including state, default methods, mixins, and type-class roles. A SimpleModeling Interface is an Object Model contract rather than a language syntax construct and is not synonymous with any particular language interface or trait.
Object-Functional Paradigm
Interface expresses an object-side contract through subtype polymorphism. Its role differs from a Type Class that adds behavior to an existing Type and from a Trait that composes a reusable partial structure.
CML
The current public CML (Cozy Modeling Language) syntax does not yet define a dedicated Interface Object kind. Introducing an external Operation or Responsibility contract into CML requires an explicit Interface representation distinguishable from a Trait that may carry structure or default behavior. Interface and Trait are not treated as synonyms while that dedicated syntax remains unsettled.
Scala
Scala has no separate interface syntax corresponding directly to Java’s; an object-side Interface is commonly realized by a trait . A Scala trait can also represent a mixin, SimpleModeling Trait, supplementary Capability, or Type Class, so it does not always denote a SimpleModeling Interface.
simplemodeling-lib
Whether a Scala trait in simplemodeling-lib corresponds to an Object Model Interface depends on whether its contract expresses only an external Responsibility of the Object itself. The implementation form alone does not determine that it is an Interface.
Public Usage
Japanese articles and videos introduce the term as インターフェース(Interface). They may explain that an Interface is used when only the object-side contract is needed, without reducing Type in general to Interface.
Boundary
-
Interface is not synonymous with Type as a whole, Class, or Trait.
-
Interface does not fix internal state or realization.
-
Interface is not synonymous with Scala trait or Type Class.