1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<link rel="STYLESHEET" href="howto.css" type='text/css' />
5
<link rel="first" href="howto.html" title='Developing applications with Kiwi' />
6
<link rel='last' href='about.html' title='About this document...' />
7
<link rel='help' href='about.html' title='About this document...' />
8
<link rel="next" href="node18.html" />
9
<link rel="prev" href="node16.html" />
10
<link rel="parent" href="node16.html" />
11
<link rel="next" href="node18.html" />
12
<meta name='aesop' content='information' />
13
<title>2.9.1 Domain Objects (or Models)</title>
16
<DIV CLASS="navigation">
17
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
18
<table align="center" width="100%" cellpadding="0" cellspacing="2">
20
<td class='online-navigation'><a rel="prev" title="2.9 Proxies and Models"
21
href="node16.html"><img src='previous.png'
22
border='0' height='32' alt='Previous Page' width='32' /></A></td>
23
<td class='online-navigation'><a rel="parent" title="2.9 Proxies and Models"
24
href="node16.html"><img src='up.png'
25
border='0' height='32' alt='Up One Level' width='32' /></A></td>
26
<td class='online-navigation'><a rel="next" title="2.9.2 Using Proxies"
27
href="node18.html"><img src='next.png'
28
border='0' height='32' alt='Next Page' width='32' /></A></td>
29
<td align="center" width="100%">Developing applications with Kiwi</td>
30
<td class='online-navigation'><img src='blank.png'
31
border='0' height='32' alt='' width='32' /></td>
32
<td class='online-navigation'><img src='blank.png'
33
border='0' height='32' alt='' width='32' /></td>
34
<td class='online-navigation'><img src='blank.png'
35
border='0' height='32' alt='' width='32' /></td>
37
<div class='online-navigation'>
38
<b class="navlabel">Previous:</b>
39
<a class="sectref" rel="prev" href="node16.html">2.9 Proxies and Models</A>
40
<b class="navlabel">Up:</b>
41
<a class="sectref" rel="parent" href="node16.html">2.9 Proxies and Models</A>
42
<b class="navlabel">Next:</b>
43
<a class="sectref" rel="next" href="node18.html">2.9.2 Using Proxies</A>
47
<!--End of Navigation Panel-->
49
<H3><A NAME="SECTION000291000000000000000">
50
2.9.1 Domain Objects (or Models)</A>
54
Doing Object Oriented (OO) implementation implies the system you are
55
creating revolves around objects; in the case of Python applications, we
56
use the word `instances'. OO applications call the instances that
57
represent your problem's logical entities
58
<em class="citetitle"><a
59
href="http://c2.com/cgi/wiki?DomainObject"
60
title="'domain objects'"
61
>'domain objects'</a></em>. In a
62
mail application, for instance, you might have Person and Message domain
63
objects; in a sales application you could have Product and Sale.
66
Picking up from our last example, you could say <tt class="class">NewsItem</tt>
67
represented a class of domain objects, since its instances held data (or
68
`state') that represented a logical container relevant to the task we
69
had at hand, browsing news. This example was very simple, and there was
70
no mechanism coded into the <tt class="class">NewsItem</tt> class, but the concept is
74
One very common problem when coding a new UI to manipulate the
75
information in a domain object - at the fundamental level, in an
76
instance - is the amount of code that needs to be done to alter the
77
state of the instance. If you have a small form, with few controls in
78
it, it's merely a bother; if you have a complex form, with many controls
79
and lots of interaction, it can be a nightmare of accessors and message
80
passing. Each widget must have the appropriate signals connected, and
81
the handlers must either manipulate the instance directly, or call
82
accessors repeatedly. Changing the UI involves more coding and
91
<LI>I use the terms <B>object, model<A NAME="tex2html6"
92
HREF="#foot272"><SUP>6</SUP></A> and instance</B>
93
interchangeably to refer to a <B>domain object</B>.
95
<LI>The problem at hand is propagating changes from the UI to the
96
domain objects attached to them.
99
This is the task Proxies attempt to simplify.
104
<BR><HR><H4>Footnotes</H4>
106
<DT><A NAME="foot272">... model</A><A
107
HREF="node17.html#tex2html6"><SUP>6</SUP></A></DT>
108
<DD>A note on naming: in
109
MVC, one third of the triad is called Model, which (I believe) is short
110
for Application Model. In theory, the Application Model represents the
111
real-world behavior of your application, just like the domain object;
112
synonyms, basically. Some authors, however, defend that the Application
113
Model and the domain object should be separate entities. I don't think
114
this is necessarily true. From my experience, in most cases the two are
115
functionally equivalent (and separating them showed me that I ended up
116
doing was proxying calls from one to the other).
120
<DIV CLASS="navigation">
121
<div class='online-navigation'>
123
<table align="center" width="100%" cellpadding="0" cellspacing="2">
125
<td class='online-navigation'><a rel="prev" title="2.9 Proxies and Models"
126
href="node16.html"><img src='previous.png'
127
border='0' height='32' alt='Previous Page' width='32' /></A></td>
128
<td class='online-navigation'><a rel="parent" title="2.9 Proxies and Models"
129
href="node16.html"><img src='up.png'
130
border='0' height='32' alt='Up One Level' width='32' /></A></td>
131
<td class='online-navigation'><a rel="next" title="2.9.2 Using Proxies"
132
href="node18.html"><img src='next.png'
133
border='0' height='32' alt='Next Page' width='32' /></A></td>
134
<td align="center" width="100%">Developing applications with Kiwi</td>
135
<td class='online-navigation'><img src='blank.png'
136
border='0' height='32' alt='' width='32' /></td>
137
<td class='online-navigation'><img src='blank.png'
138
border='0' height='32' alt='' width='32' /></td>
139
<td class='online-navigation'><img src='blank.png'
140
border='0' height='32' alt='' width='32' /></td>
142
<div class='online-navigation'>
143
<b class="navlabel">Previous:</b>
144
<a class="sectref" rel="prev" href="node16.html">2.9 Proxies and Models</A>
145
<b class="navlabel">Up:</b>
146
<a class="sectref" rel="parent" href="node16.html">2.9 Proxies and Models</A>
147
<b class="navlabel">Next:</b>
148
<a class="sectref" rel="next" href="node18.html">2.9.2 Using Proxies</A>
152
<span class="release-info">Release 1.9.12, documentation updated on August, 2006.</span>
154
<!--End of Navigation Panel-->