(* RSL Examples showing how UML syntax is handled. Words in ALLCAPS are the UML terminology for the example shown. Written by: Dan Stearns Date: Fall 1998 CSC 205 Modified 10/28 Added Associaton Class Example *) (* There is N-N ASSOCIATION between student and section *) (* This is a user-defined attribute; its primary use is to define ASSOCIATION relationships and ASSOCIATION CLASSES *) define object attribute associates_with: Enrollment; -- ^^^^^^^^^^^^ -- The association_class attribute is no longer needed. -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ object Section components: number:string and quarter:number and Course and inst:string; associates_with: Students; -- no more association_class attribute here -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ operations: (* *); description: (* number, quarter and inst are ATTRIBUTES Course is an AGGREGRATE associates_with defines an ASSOCIATION relationship Enrollment defines an ASSOCIATION Class -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with attributes related to the association *); end Section; (* Shorthand if no components nor operations defined *) object Sections = Section*; object Enrollment components: grade:string; -- No more associates_with needed here -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ operations: (* *); description: (* Enrollment is an ASSOCIATION CLASS that defines the attributes of an association between two other classes. *); end Enrollment; object Student components: Name:string and Id:number and Major:string; associates_with: Sections; -- no more association_class attribute here -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ operations: (* *); description: (* Student is a SUPER CLASS - a general template of which other types may be defined *); end Student; (* Shorthand if no components nor operations defined *) object Students = Student*; object Course; -- Just a place holder