THE CLPROLF PROGRAMMING LANGUAGE


CLPROLF – Explaining Declensions

Clprolf is a language and framework that helps you design objects with a single, explicit responsibility. By assigning each class a role (also called its declension), you ensure compliance with the Single Responsibility Principle (SRP). Objects become components, and this clarity remains intact even with inheritance.


What Is a Declension?

A declension expresses the nature of a class — its fundamental role in the system. Clprolf defines only a few basic roles, which keeps design unambiguous and intuitive.

The five available declensions are:

  1. agent Synonyms: abstraction, simu_real_obj.

  2. worker_agent Synonyms: comp_as_worker.

  3. model (no synonyms).

  4. information (no synonyms).

  5. indef_obj A flexible object without explicit role, behaving like a traditional OO class.


Synonyms and Aspects

Each declension keeps only a minimal set of synonyms, and every synonym reflects a specific aspect:

This structure makes the system both easy to memorize and easy to teach. Synonyms are no longer arbitrary alternatives but clearly justified by the perspective they express.


Business-Like Objects

These objects represent real-world abstractions or domain concepts.


Technical Objects

These objects handle purely computational or support tasks. Here, the computer itself is seen as the actor.

Examples: system utilities, DAOs, repositories, low-level services, or MVC view components.


Declensions and Genders

Declensions can be refined with genders (optional sub-roles). They may also have synonyms:

⚠️ Genders apply only to agents, except @Static, which may also apply to worker_agent.


Interrelationships Between Declensions

These reversals usually reveal a design flaw or a deliberate reinterpretation.


Interfaces and Declensions

Interfaces also have declensions:

Declensions on interfaces specify which classes are allowed to implement them.

Capacity interfaces can also have a gender called Advice:


Inheritance Consistency

Clprolf enforces that inheritance stays role-consistent:


Using Declensions

In pure Clprolf, the declension replaces the class keyword. In the framework, it appears as an annotation above the class.

Example:

@Agent
public class Animal { ... }

Algorithm for Choosing a Declension

Every class must declare a role.

Step 1 – Does the class have methods?

Step 2 – Is the responsibility business-related or technical?


Example: System Class in Java

At first sight: @Worker_agent (low-level, technical).

But Clprolf favors @Agent whenever possible. System could also be seen as:


Summary

Result: a simpler, more maintainable system, where every object is clearly positioned.


Notice

If the class already fits one of the well-known architectural categories, you can directly assign a matching role: