user2019510
user2019510

Reputation: 1470

What is the corresponding of structured classifier in Programming Language like Java?

Structured Classifier is a concept related to Modeling Language like UML(Unified Modeling Language) which contains Parts or Roles that form its data Structure and realize its behavior.

What is the corresponding of structured classifier in Programming Language like Java?

Upvotes: 2

Views: 232

Answers (2)

Aleks
Aleks

Reputation: 5864

Structured Classifier is an abstract concept, with no direct counterpart in JAVA. However, you can create a JAVA class structure that mimics its organization and concepts.

Here is the example of Structured Classifier, taken from the formal UML spec:

enter image description here

What makes the class Car a Structured Classifier is its internal structure made up of a network of connected object in a strictly defined way (roles).

To implement this in Java, you first need to:

  1. Create 3 Java classes, corresponding to Car, Wheel and Engine
  2. Add some kind of interfaces to Engine, that permit to connect it to 2 Weels. It can also be done with 2 data members of a type Wheel
  3. Add 3 private data members to Car - "rear" (array of 2 instances of Wheel) and "e" (an instance of Engine)
  4. Ensure that Wheels and Engine are correctly connected within a Car (in a class constructor for example)
  5. Eventually add methods with additional logic performed by these elements

Upvotes: 3

Diferdin
Diferdin

Reputation: 1260

Your description is not really clear, and browsing over the web I got a slightly more structured definition:

A structured classifier is an abstract metaclass that represents any classifier whose behavior can be fully or partly described by the collaboration of owned or referenced instances.

If that is the case, I guess you can have an organised structure of interfaces or abstract classes to reach some thing similar...

Hope this helps.

Upvotes: 1

Related Questions