Concept In Cop

[in ConceptOriented]

Concept is a pair of one object class and one reference class. Instance of object class are referred to as objects and are passed by reference. Instances of reference class are referred to as references and are passed by value. Here is an example of concept definition:

  concept Myconcept in Parentconcept 
    class {
      int myField; 
      int myMethod() { ... } 
      void continue() { ... } 
      void create() { ... } // Object constructor 
      void delete() { ... } // Object destructor 
    }
    reference {
      int id; // Identifier 
      int myMethod() { ... } 
      void continue() { ... } // Reference resolution 
      void create() { ... } // Reference constructor 
      void delete() { ... } // Reference destructor 
    }

Any concept is included in some other concept. In this example, we used keyword 'in' in order to specify a superconcept. Concepts are the main construct in the ConceptOrientedProgramming. A concept-oriented program is then a hierarchy of concepts. The root of the hierarchy is provided by the compiler, interpreter or an execution environment. For example, in C++ it is the operating system memory manager providing memory handles and the corresponding access mechanism. In Java, it is the Java Virtual Machine with its reference format and object access mechanism. The idea of the ConceptOrientedProgramming is that we can develop our own environments with custom representation and access mechanism using concepts. Concept in this sense is a construct which combines properties of normal objects with containers responsible for managing other objects. One concept can be viewed as a description of one space border with some intermediate functionality triggered automatically and executed behind the scenes when a process intersects it.

Any access starts from the root and then proceeds to the target concept. In order to pass through the border, a special method needs to be defined by intermediate concepts, called continue. The continuation methods of objects and reference alternate. A reference continuation method resolves its reference and the obtained root reference is used to proceed to the corresponding object using its continuation method. This object continuation method calls the next reference continuation method, which is again resolved into the root reference which is used to call the next object continuation object and so on down to the target object. The target business method starts when (and if) the access procedure reaches this object by consecutively resolving all its parent references.

An important role in object and reference life-cycle management is played by concept creation and deletion methods, called create and delete, respectively. It is another example of dual methods which have the same signature in both the object class and the reference class. When defined in the object class, they are responsible for this object initialization/clean up and hence they are equivalent to the traditional constructor/destructor. When defined in the reference class, they are responsible for this reference initialization/clean up.

More information on the concept-oriented programming can be found at the concept-oriented portal here http://conceptoriented.com. It also includes information on the ConceptOrientedModel and other related issues.


WalledGarden (of ConceptOriented pages)


EditText of this page (last edited January 30, 2009) or FindPage with title or text search