-
Notifications
You must be signed in to change notification settings - Fork 0
Subject
According to The Free On-line Dictionary of Computing, a subject in subject-oriented programming is defined as follows:
-
Collection of Classes or Class Fragments: A subject is comprised of classes or parts of classes, each modeling a specific domain in a unique way within the subject.
-
Subjective Modeling of Domain: Subjects model their respective domains subjectively. This means the same conceptual element might have different representations across subjects.
-
Subjects as Complete or Incomplete Applications: Subjects can either be standalone applications or incomplete fragments. This allows them to be developed in isolation or combined with other subjects for more complex applications.
-
Subject Composition: A key feature where subjects are combined to create new ones. Class hierarchies from original subjects are merged, integrating their functionalities.
-
Modeling of Functionality Through Class Hierarchies: Functionality and behavior within a subject are encapsulated in its class hierarchy, representing the subject's view of its domain.
Subject-oriented programming emphasizes modularization and flexibility, suitable for complex applications with distinct parts requiring different views or data models.
Subject-oriented programming and Java packages have similarities but also distinct differences:
- Subjects: Create modular code by organizing around specific application aspects or 'subjects'.
- Java Packages: Also used for modularity, organizing classes, interfaces, and sub-packages based on functionality.
- Subjects: Focus on a specific aspect of the application, potentially across different class hierarchies.
- Java Packages: More about organizing classes based on functionality and scope.
- Subjects: Emphasize the composition of new functionalities by merging class hierarchies.
- Java Packages: Primarily for organization; don't inherently offer mechanisms for merging functionalities.
- Java Packages: Serve as a namespace mechanism to avoid name conflicts and control access (public, protected, etc.).
- Subjects: While also dealing with scope, they focus more on the conceptual organization of application parts.
- Subjects: Can represent complete applications or parts, focusing on conceptual organization.
- Java Packages: Organize components of one or more applications, not inherently representing the structure of an application.
In summary, while both provide modularity and organization, subject-oriented programming is more about conceptual composition and aspect representation, whereas Java packages are structural features for organizing classes, managing namespaces, and controlling access within applications.