~openerp-vietnam/openobject-doc/technical-tutorial

« back to all changes in this revision

Viewing changes to build/html/architecture/mvc.html

  • Committer: Najlaâ EL KHAYAT
  • Date: 2009-04-07 12:47:35 UTC
  • Revision ID: nel@tinyerp.com-20090407124735-fvnl6acj42fhff34
doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
 
 
4
<html xmlns="http://www.w3.org/1999/xhtml">
 
5
  <head>
 
6
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
7
    
 
8
    <title>MVC - Model, View, Controller &mdash; openerp v1 documentation</title>
 
9
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
 
10
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
 
11
    <script type="text/javascript">
 
12
      var DOCUMENTATION_OPTIONS = {
 
13
        URL_ROOT:    '../',
 
14
        VERSION:     '1',
 
15
        COLLAPSE_MODINDEX: false,
 
16
        FILE_SUFFIX: '.html',
 
17
        HAS_SOURCE:  true
 
18
      };
 
19
    </script>
 
20
    <script type="text/javascript" src="../_static/jquery.js"></script>
 
21
    <script type="text/javascript" src="../_static/doctools.js"></script>
 
22
    <link rel="top" title="openerp v1 documentation" href="../index.html" />
 
23
    <link rel="up" title="OpenObject Architecture - MVC" href="index.html" />
 
24
    <link rel="next" title="MVCSQL" href="mvc_sql.html" />
 
25
    <link rel="prev" title="OpenObject Architecture - MVC" href="index.html" /> 
 
26
  </head>
 
27
  <body>
 
28
    <div class="related">
 
29
      <h3>Navigation</h3>
 
30
      <ul>
 
31
        <li class="right" style="margin-right: 10px">
 
32
          <a href="../genindex.html" title="General Index"
 
33
             accesskey="I">index</a></li>
 
34
        <li class="right" >
 
35
          <a href="mvc_sql.html" title="MVCSQL"
 
36
             accesskey="N">next</a> |</li>
 
37
        <li class="right" >
 
38
          <a href="index.html" title="OpenObject Architecture - MVC"
 
39
             accesskey="P">previous</a> |</li>
 
40
        <li><a href="../index.html">openerp v1 documentation</a> &raquo;</li>
 
41
          <li><a href="index.html" accesskey="U">OpenObject Architecture - MVC</a> &raquo;</li> 
 
42
      </ul>
 
43
    </div>  
 
44
 
 
45
    <div class="document">
 
46
      <div class="documentwrapper">
 
47
        <div class="bodywrapper">
 
48
          <div class="body">
 
49
            
 
50
  <div class="section" id="mvc-model-view-controller">
 
51
<h1>MVC - Model, View, Controller<a class="headerlink" href="#mvc-model-view-controller" title="Permalink to this headline">¶</a></h1>
 
52
<p>According to <a class="reference external" href="http://en.wikipedia.org/wiki/Model-view-controller">Wikipedia</a>,&#8221;a Model-view-controller (MVC) is an architectural pattern used in software engineering. In complex computer applications that present lots of data to the user, one often wishes to separate data (model) and user interface (view) concerns, so that changes to the user interface do not impact the data handling, and that the data can be reorganized without changing the user interface. The model-view-controller solves this problem by decoupling data access and business logic from data presentation and user interaction, by introducing an intermediate component: the controller.&#8221;</p>
 
53
<div align="center" class="figure">
 
54
<a class="reference external image-reference" href="architecture/images_arch/MVCDiagram.png"><img alt="architecture/images_arch/MVCDiagram.png" src="architecture/images_arch/MVCDiagram.png" /></a>
 
55
</div>
 
56
<p>For example, in the diagram above, the solid lines for the arrows starting from the controller and going to both the view and the model mean that the controller has a complete access to both the view and the model. The dashed line for the arrow going from the view to the controller means that the view has a limited access to the controller. The reasons of this design are :</p>
 
57
<blockquote>
 
58
<ul class="simple">
 
59
<li>From <strong>View</strong> to <strong>Model</strong> : the model sends notification to the view when its data has been modified in order the view to redraw its content. The model doesn&#8217;t need to know the inner workings of the view to perform this operation. However, the view needs to access the internal parts of the controller.</li>
 
60
<li>From <strong>View</strong> to <strong>Controller</strong> : the reason why the view has limited access to the controller is because the dependencies from the view to the controller need to be minimal: the controller can be replaced at any moment.</li>
 
61
</ul>
 
62
</blockquote>
 
63
<div class="section" id="mvc-model-in-tiny-erp">
 
64
<h2>MVC Model in Tiny ERP<a class="headerlink" href="#mvc-model-in-tiny-erp" title="Permalink to this headline">¶</a></h2>
 
65
<p>In Tiny ERP, we can apply this model-view-controller semantic with</p>
 
66
<blockquote>
 
67
<ul class="simple">
 
68
<li>model : The PostgreSQL tables.</li>
 
69
<li>view : views are defined in XML files in Tiny ERP.</li>
 
70
<li>controller : The objects of TinyERP.</li>
 
71
</ul>
 
72
</blockquote>
 
73
</div>
 
74
</div>
 
75
 
 
76
 
 
77
          </div>
 
78
        </div>
 
79
      </div>
 
80
      <div class="sphinxsidebar">
 
81
        <div class="sphinxsidebarwrapper">
 
82
            <h3><a href="../index.html">Table Of Contents</a></h3>
 
83
            <ul>
 
84
<li><a class="reference external" href="">MVC - Model, View, Controller</a><ul>
 
85
<li><a class="reference external" href="#mvc-model-in-tiny-erp">MVC Model in Tiny ERP</a></li>
 
86
</ul>
 
87
</li>
 
88
</ul>
 
89
 
 
90
            <h4>Previous topic</h4>
 
91
            <p class="topless"><a href="index.html"
 
92
                                  title="previous chapter">OpenObject Architecture - MVC</a></p>
 
93
            <h4>Next topic</h4>
 
94
            <p class="topless"><a href="mvc_sql.html"
 
95
                                  title="next chapter">MVCSQL</a></p>
 
96
            <h3>This Page</h3>
 
97
            <ul class="this-page-menu">
 
98
              <li><a href="../_sources/architecture/mvc.txt"
 
99
                     rel="nofollow">Show Source</a></li>
 
100
            </ul>
 
101
          <div id="searchbox" style="display: none">
 
102
            <h3>Quick search</h3>
 
103
              <form class="search" action="../search.html" method="get">
 
104
                <input type="text" name="q" size="18" />
 
105
                <input type="submit" value="Go" />
 
106
                <input type="hidden" name="check_keywords" value="yes" />
 
107
                <input type="hidden" name="area" value="default" />
 
108
              </form>
 
109
              <p class="searchtip" style="font-size: 90%">
 
110
              Enter search terms or a module, class or function name.
 
111
              </p>
 
112
          </div>
 
113
          <script type="text/javascript">$('#searchbox').show(0);</script>
 
114
        </div>
 
115
      </div>
 
116
      <div class="clearer"></div>
 
117
    </div>
 
118
    <div class="related">
 
119
      <h3>Navigation</h3>
 
120
      <ul>
 
121
        <li class="right" style="margin-right: 10px">
 
122
          <a href="../genindex.html" title="General Index"
 
123
             >index</a></li>
 
124
        <li class="right" >
 
125
          <a href="mvc_sql.html" title="MVCSQL"
 
126
             >next</a> |</li>
 
127
        <li class="right" >
 
128
          <a href="index.html" title="OpenObject Architecture - MVC"
 
129
             >previous</a> |</li>
 
130
        <li><a href="../index.html">openerp v1 documentation</a> &raquo;</li>
 
131
          <li><a href="index.html" >OpenObject Architecture - MVC</a> &raquo;</li> 
 
132
      </ul>
 
133
    </div>
 
134
    <div class="footer">
 
135
      &copy; Copyright 2009, openerp.
 
136
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
 
137
    </div>
 
138
  </body>
 
139
</html>
 
 
b'\\ No newline at end of file'