Component and Set

From Parham Language
Jump to: navigation, search

The Parham programming language is based on the SOP (Set Oriented Programming) paradigm. It is based on two basic abstractions: component and set.


Component[edit]

In Parham, an application is a collection of components. One component is the main component that defines the whole functionality of the application. Other components are instantiated in order to use.

Component is the main abstraction of the SOP paradigm which encapsulates a functionality. For example, a component can be defined to encapsulate a data structure such as a queue or it can encapsulate a software module such as a university.

Set[edit]

Set is the collection of objects having the same role in a component. It is somewhat similar to the class in the object oriented paradigm. However, unlike class, set does not define the whole functionality of an object. It just define the functionality that a component expects from an object.

For example, the Queue component has two sets of objects: objects that can be roots of the queue and objects that can be nodes (members) of the queue. Therefore, it has two sets: Root and Node.

Parham identifies two types of sets: internal sets and interface sets. An internal set is a set that the behavior of its members is completely defined by the container component. An interface set is a set that the behavior of its members is partially defined by the container component.

In the Queue component, both sets are interface sets. The reason is clear. Their behavior is partially defined by the Queue component.


Queue[Root, Node] {

   ...

}



Application[edit]

In Parham, every application is a collection of component. Except the main component that does not have any interface set, every other component should have at least one interface set.



Tutorial