View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: IModel.java
13   * Created: 2007-12-15
14   * Author: apohllo
15   * $Id: IModel.java 2232 2009-01-04 22:59:53Z apohllo $
16   */
17  
18  package pl.edu.agh.cast.model.base;
19  
20  import java.util.Collection;
21  import java.util.List;
22  
23  import pl.edu.agh.cast.model.mapper.Mappable;
24  
25  /**
26   * <p>
27   * The model interface represents single unit of work. One model may contain many data sets. The model name must be uniq
28   * globally (i.e. within the Eclipse workspace). <br/>
29   * The model primarly consists of entities and relations. The relations are organized into data sets.
30   * </p>
31   *
32   * <p>
33   * Model corresponds to the IProject, but since it does not contain diagrams (while IProject does) it is separated from
34   * it. The diagrams in the IProject contain some visual data (e.g. the entity icon) while IModel only contains "raw"
35   * data. <br>
36   *
37   * The other difference is that in the default implementation the model is mapped to base model, while IProject is not
38   * (it is kept in the Eclipse Workspace).
39   * </p>
40   *
41   *
42   * @author AGH CAST Team
43   *
44   */
45  public interface IModel extends Mappable {
46  
47  	/**
48  	 * Return all relations which belong to this model.
49  	 *
50  	 * @return The collection of all relations
51  	 */
52  	List<IRelation> getRelations();
53  
54  	/**
55  	 * Return all data sets which belong to this model.
56  	 *
57  	 * @return The collection of all data sets
58  	 */
59  	List<IDataSet> getDataSets();
60  
61  	/**
62  	 * Data sets setter.
63  	 *
64  	 * @param dataSets
65  	 *            The data sets to set.
66  	 */
67  	void setDataSets(List<IDataSet> dataSets);
68  
69  	/**
70  	 * Add data set to the collection of data sets.
71  	 *
72  	 * @param dataSet
73  	 *            The data set to add.
74  	 * @return True if the set was add
75  	 */
76  	boolean addDataSet(IDataSet dataSet);
77  
78  	/**
79  	 * Model name getter.
80  	 *
81  	 * @return the name of the model.
82  	 */
83  	String getName();
84  
85  	/**
86  	 * Model name setter.
87  	 *
88  	 * @param name
89  	 *            New name of the model
90  	 */
91  	void setName(String name);
92  
93  	/**
94  	 * Return all entities which are present in this model.
95  	 *
96  	 * @return Collection of entities
97  	 */
98  	Collection<IEntity> getEntities();
99  }