Class

Term

Class

Aliases

-

Identity

  • Term ID: src/main/doxsite/glossary/object-foundation/class.dox

  • English label: Class

  • Japanese label: クラス

  • Category: Object Foundation

  • Status: normative

  • Definition authority: SimpleModeling BoK

DEFINITION

A Class is a primary Object Model element that classifies a set of Objects and formally describes their structure, state, behavior, and responsibilities. A Class is a named object-side Type and describes that Type’s model-level realization.

UML

In UML 2.5.1, a Class is a Classifier that classifies a set of Objects and specifies Features that characterize their structure and behavior. Class specializes Classifier, and Classifier specializes Type, so a Class is itself a Type. The phrase "model-level realization" in SimpleModeling describes its explanatory role and does not denote a UML Realization relationship.

Object-Functional Paradigm

A Class represents an object-side conceptual trunk, intrinsic state, invariants, operations, and lifecycle. Reusable partial structures and Capabilities composed across multiple Classes may be separated into Traits, while externally visible contracts may be separated into Interfaces. The Type induced by a Class can connect to functional contracts such as functions, results, effects, and type classes.

CML

The current public CML (Cozy Modeling Language) syntax defines concrete Object kinds such as Entity and Value rather than a generic Class Object kind. These are treated as Class-like Classifiers, while shared partial structures may be separated into Traits. Cozy may realize a Model Class using a combination of Scala abstract classes, classes, case classes, traits, and other constructs according to meaning, so the Model Class and Scala class do not have a one-to-one mapping.

Scala

A Scala class declaration introduces both a Class and a Type for its instances. Scala Types also include traits, enums, opaque types, function types, union types, intersection types, and other forms, so Type and Class are not synonyms in Scala either.

simplemodeling-lib

The simplemodeling-lib Type Modeling Rule uses Scala abstract class for a Domain Model’s conceptual trunk, constructor semantics, state, and inheritance invariants, and uses trait for supplementary composable capabilities. These are Scala realization policies and do not change the canonical definition of Class.

Public Usage

Japanese articles and videos introduce the term as クラス(Class). They say that a Class is itself a Type and describes Object structure and behavior, rather than saying that a Class describes a separate Type. Part 5 focuses on its role relative to Type, Interface, and Trait without teaching the complete Classifier hierarchy.

Boundary

  • Class is not synonymous with Type. It is one kind of object-side Type.

  • Class is not synonymous with Trait. A Class represents a conceptual trunk, while a Trait represents a composable partial structure.

  • Class is not synonymous with Interface or Class Diagram.

  • An Object classified by a Class does not necessarily have persistent Entity identity.

  • Type

  • Classifier

  • Interface

  • Trait

  • Object

  • Class Diagram

References