KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jdon > controller > model > ModelIF


1 /**
2  * Copyright 2003-2006 the original author or authors.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6
7  http://www.apache.org/licenses/LICENSE-2.0
8
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */

15
16 package com.jdon.controller.model;
17
18 import java.io.Serializable JavaDoc;
19
20 import com.jdon.controller.cache.Cacheable;
21
22 /**
23  * Base domain model it can be DTO or nested Model. it is the important message
24  * between business layer and view layer. in view layer, it is created by form
25  * object(such as ActionForm object);in business layer, it is created by
26  * business components(such as session bean).
27  *
28  * thi class can be cached, and setModified is important, this method can be
29  * used to refresh the cache.
30  *
31  * because setModified function ,so the class is designed for a class, but not a
32  * interface.
33  *
34  * the difference with setModified and setCacheable;
35  * setCacheable to false, the model will never exist in the cache.
36  * setModified to true, if the model exists in the cache, the client will not
37  * get it from cache, it is same as being deleted from cache .
38  * deleting the model from cache must have a condition that the deleting operator
39  * can access the cache of the container, if it cann't access the container,
40  * it cann't delete the model from cache. such it is EJB.
41  *
42  *
43  *
44  * @author banq
45  */

46 public interface ModelIF extends Cacheable, Cloneable JavaDoc, Serializable JavaDoc {
47
48     /**
49      * in the past version, this method name is isCacheble,
50      * now change it after 1.3 !
51      */

52     public boolean isCacheable();
53     
54     /**
55      * in the past version, this method name is setCacheble,
56      * now change it after 1.3 !
57      */

58     public void setCacheable(boolean cacheable);
59     
60     public boolean isModified();
61
62     /**
63      * set the property has been modified such as : setName(String name){
64      * this.name = name; setModified(true); }
65      *
66      */

67     public void setModified(boolean modified) ;
68     
69     
70
71 }
72
Popular Tags