--- /dev/null
+package org.simantics.structural2.scl;\r
+\r
+import org.simantics.db.Resource;\r
+\r
+\r
+/**\r
+ * Represents a structural configuration.\r
+ * Has exactly two subclasses {@link StructuralComponent} and {@link StructuralComposite}.\r
+ * \r
+ * @author Hannu Niemistö\r
+ */\r
+public abstract class StructuralConfiguration<Connection> {\r
+ /*\r
+ * Prevents extending this class outside of this package. \r
+ */\r
+ public StructuralConfiguration() {\r
+ }\r
+ \r
+ /**\r
+ * Returns underlying resource of the configuration.\r
+ * It can be used to obtain information about the configuration\r
+ * that is not accessible using StructuralComponent or\r
+ * StructuralComposite. For procedural configurations\r
+ * this method may return {@code null} or a resource\r
+ * that represents a template of the configuration.\r
+ */\r
+ public abstract Resource getResource();\r
+ \r
+ /**\r
+ * If the configuration is a root composite of a component\r
+ * type, there are two possible resources that could be\r
+ * reasonably returned in getResource(). New getResource()\r
+ * returns the resource that is linked with IsDefinedBy from\r
+ * the component type and getInstanceResource() returns the\r
+ * instance of the component type. In all other cases this\r
+ * method returns the same resource as getResource().\r
+ */\r
+ public Resource getInstanceResource() {\r
+ return getResource();\r
+ }\r
+ \r
+ public abstract StructuralComponent<Connection> getContext();\r
+}\r