<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2803760956637347555</id><updated>2011-07-07T21:12:34.923-07:00</updated><category term='interface'/><category term='OOP'/><category term='C#'/><category term='ActionScript'/><category term='OO languages'/><category term='view'/><title type='text'>RIA Architecture</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dakurai.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2803760956637347555/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dakurai.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vo Hong Vinh</name><uri>http://www.blogger.com/profile/08085515550482870323</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2803760956637347555.post-1404043726030485127</id><published>2009-10-09T20:37:00.000-07:00</published><updated>2009-10-09T20:56:34.337-07:00</updated><title type='text'>VẤN ĐỀ GIAO TIẾP TRONG KIẾN TRÚC MODULE</title><content type='html'>&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:officedocumentsettings&gt;   &lt;o:relyonvml/&gt;   &lt;o:allowpng/&gt;  &lt;/o:OfficeDocumentSettings&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves&gt;false&lt;/w:TrackMoves&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face  {font-family:Wingdings;  panose-1:5 0 0 0 0 0 0 0 0 0;  mso-font-charset:2;  mso-generic-font-family:auto;  mso-font-pitch:variable;  mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face  {font-family:"Cambria Math";  panose-1:2 4 5 3 5 4 6 3 2 4;  mso-font-charset:1;  mso-generic-font-family:roman;  mso-font-format:other;  mso-font-pitch:variable;  mso-font-signature:0 0 0 0 0 0;} @font-face  {font-family:Calibri;  panose-1:2 15 5 2 2 2 4 3 2 4;  mso-font-charset:0;  mso-generic-font-family:swiss;  mso-font-pitch:variable;  mso-font-signature:-520092929 1073786111 9 0 415 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal  {mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-parent:"";  margin-top:0in;  margin-right:0in;  margin-bottom:10.0pt;  margin-left:0in;  text-align:justify;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} h1  {mso-style-priority:9;  mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-link:"Heading 1 Char";  mso-style-next:Normal;  margin-top:30.0pt;  margin-right:0in;  margin-bottom:12.0pt;  margin-left:0in;  text-align:justify;  line-height:115%;  mso-pagination:widow-orphan lines-together;  page-break-after:avoid;  mso-outline-level:1;  font-size:14.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:major-fareast;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:major-bidi;  color:#365F91;  mso-themecolor:accent1;  mso-themeshade:191;  mso-font-kerning:0pt;  font-weight:bold;} p.MsoCaption, li.MsoCaption, div.MsoCaption  {mso-style-priority:35;  mso-style-qformat:yes;  mso-style-next:Normal;  margin-top:0in;  margin-right:0in;  margin-bottom:10.0pt;  margin-left:0in;  text-align:justify;  mso-pagination:widow-orphan;  font-size:9.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;  color:#4F81BD;  mso-themecolor:accent1;  font-weight:bold;} a:link, span.MsoHyperlink  {mso-style-priority:99;  color:blue;  text-decoration:underline;  text-underline:single;} a:visited, span.MsoHyperlinkFollowed  {mso-style-noshow:yes;  mso-style-priority:99;  color:purple;  mso-themecolor:followedhyperlink;  text-decoration:underline;  text-underline:single;} p  {mso-style-priority:99;  mso-margin-top-alt:auto;  margin-right:0in;  mso-margin-bottom-alt:auto;  margin-left:0in;  text-align:justify;  mso-pagination:widow-orphan;  font-size:12.0pt;  font-family:"Times New Roman","serif";  mso-fareast-font-family:"Times New Roman";} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph  {mso-style-priority:34;  mso-style-unhide:no;  mso-style-qformat:yes;  margin-top:0in;  margin-right:0in;  margin-bottom:10.0pt;  margin-left:.5in;  mso-add-space:auto;  text-align:justify;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst  {mso-style-priority:34;  mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-type:export-only;  margin-top:0in;  margin-right:0in;  margin-bottom:0in;  margin-left:.5in;  margin-bottom:.0001pt;  mso-add-space:auto;  text-align:justify;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle  {mso-style-priority:34;  mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-type:export-only;  margin-top:0in;  margin-right:0in;  margin-bottom:0in;  margin-left:.5in;  margin-bottom:.0001pt;  mso-add-space:auto;  text-align:justify;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast  {mso-style-priority:34;  mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-type:export-only;  margin-top:0in;  margin-right:0in;  margin-bottom:10.0pt;  margin-left:.5in;  mso-add-space:auto;  text-align:justify;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} span.Heading1Char  {mso-style-name:"Heading 1 Char";  mso-style-priority:9;  mso-style-unhide:no;  mso-style-locked:yes;  mso-style-link:"Heading 1";  mso-ansi-font-size:14.0pt;  mso-bidi-font-size:14.0pt;  font-family:"Arial","sans-serif";  mso-ascii-font-family:Arial;  mso-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:major-fareast;  mso-hansi-font-family:Arial;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:major-bidi;  color:#365F91;  mso-themecolor:accent1;  mso-themeshade:191;  font-weight:bold;} .MsoChpDefault  {mso-style-type:export-only;  mso-default-props:yes;  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} .MsoPapDefault  {mso-style-type:export-only;  margin-bottom:10.0pt;  line-height:115%;} @page Section1  {size:8.5in 11.0in;  margin:1.0in 1.0in 1.0in 1.0in;  mso-header-margin:.5in;  mso-footer-margin:.5in;  mso-paper-source:0;} div.Section1  {page:Section1;}  /* List Definitions */  @list l0  {mso-list-id:239408174;  mso-list-type:hybrid;  mso-list-template-ids:-1752791580 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1  {mso-level-tab-stop:none;  mso-level-number-position:left;  text-indent:-.25in;} @list l1  {mso-list-id:860515247;  mso-list-type:hybrid;  mso-list-template-ids:264960530 -697677448 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l1:level1  {mso-level-start-at:0;  mso-level-number-format:bullet;  mso-level-text:-;  mso-level-tab-stop:none;  mso-level-number-position:left;  margin-left:20.25pt;  text-indent:-.25in;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;} @list l1:level2  {mso-level-number-format:bullet;  mso-level-text:o;  mso-level-tab-stop:none;  mso-level-number-position:left;  margin-left:56.25pt;  text-indent:-.25in;  font-family:"Courier New";} ol  {margin-bottom:0in;} ul  {margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-qformat:yes;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin-top:0in;  mso-para-margin-right:0in;  mso-para-margin-bottom:10.0pt;  mso-para-margin-left:0in;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Calibri","sans-serif";  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;h1&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;Đ&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;ây là bài viết gốc chưa được chỉnh sửa so với bài trên PC World 06/2009.&lt;/span&gt;&lt;br /&gt;&lt;/h1&gt;&lt;h1&gt;Giới thiệu về lập trình theo kiến trúc module (Modular programming)&lt;/h1&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Lập trình theo kiến trúc module là kĩ thuật chia nhỏ phần mềm thành những phần tách biệt nhau gọi là module. Các module được kết nối với nhau bằng một cấu trúc đơn giản và có thể được phát triển một cách độc lập.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Để bảo đảm tính toàn vẹn của cấu trúc, kiến trúc module cần được duy trì và thực hiện xuyên suốt khi tạo kiến trúc hệ thống, thiết kế, coding. Một số ngôn ngữ hỗ trợ lập trình theo cơ chế module còn cho phép biên dịch các module một cách độc lập và có thể gắn kết vào hệ thống vào thời điểm runtime như Flex, Ruby… Một số ngôn ngữ khác thì hỗ trợ cơ chế như thư viện liên kết động (như dll) để biên dịch các module thành các thư viện độc lập và có thể gắn kết động vào hệ thống. Kiến trúc module cũng dễ dàng áp dụng đối với các ngôn ngữ lập trình web.&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_mPLw4KFyxU0/StACKfBnaRI/AAAAAAAAAA8/00ZB2qwVk1s/s1600-h/Modular1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 381px; height: 185px;" src="http://3.bp.blogspot.com/_mPLw4KFyxU0/StACKfBnaRI/AAAAAAAAAA8/00ZB2qwVk1s/s400/Modular1.png" alt="" id="BLOGGER_PHOTO_ID_5390811133112707346" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoListParagraph" style="margin-left: 20.25pt; text-align: center; page-break-after: avoid;" align="center"&gt;&lt;span style=""&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:f&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/o:lock&gt;&lt;v:shape id="Picture_x0020_4" spid="_x0000_i1030" type="#_x0000_t75" alt="Modularity.gif" style="width: 270pt; height: 135pt; visibility: visible;"&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.gif" title="Modularity"&gt; &lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/v:path&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoCaption" style="text-align: center;" align="center"&gt;Figure &lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-begin'"&gt;&lt;/span&gt;&lt;span style="'mso-spacerun:yes'"&gt; &lt;/span&gt;SEQ Figure \* ARABIC &lt;span style="'mso-element:"&gt;&lt;/span&gt;&lt;![endif]--&gt;&lt;span style=""&gt;1&lt;/span&gt;&lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-end'"&gt;&lt;/span&gt;&lt;![endif]--&gt; : Phân rã phân mềm thành các module được nối kết với nhau&lt;/p&gt;  &lt;h1&gt;Tại sao lại nghiên cứu và sử dụng kiến trúc module&lt;/h1&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Về mặt khái niệm, kĩ thuật module cho phép chia nhỏ bài toán (hay yêu cầu) của phần mềm thành các phần hầu như không trùng lắp và do đó hỗ trợ làm việc song song trên các module và đặc biệt là dễ bảo trì hơn (maintainability). Kiến trúc module cũng là chìa khóa để đạt tới các khả năng tái sử dụng các thành phần của hệ thống (reusability) và khả năng mở rộng tốt hơn (extendibility).&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Những ví dụ dễ thấy của kiến trúc module là các môi trường như Eclipse, Visual Studio. Chúng được tạo ra như những nền tảng cơ bản trong đó việc support các ngôn ngữ như Java, C#… được tổ chức như các plugin và có thể dễ dàng gắn vào nền tảng. Chúng ta cũng có thể thấy công cụ Visual Studio đi kèm các bộ SQL Professional để hỗ trợ các project của SQL server dưới tên khác là SQL Server Business Intelligence Development Studio. Việc tổ chức như thế thậm chí còn cho phép các nhà phát triển thứ 3 dễ dàng phát triển các tính năng mở rộng, như bổ sung hỗ trợ PHP vào Visual Studio qua plugin VS.Php. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Các ứng dụng web như các CMS Joomla, Drupal cũng được xây dựng trên nền tảng module và do đó dễ dàng cho cộng đồng cùng phát triển và dễ mở rộng.&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_mPLw4KFyxU0/StACZrAq-WI/AAAAAAAAABE/GVGQizgtoJQ/s1600-h/Modular2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 180px;" src="http://3.bp.blogspot.com/_mPLw4KFyxU0/StACZrAq-WI/AAAAAAAAABE/GVGQizgtoJQ/s400/Modular2.png" alt="" id="BLOGGER_PHOTO_ID_5390811394028009826" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 20.25pt; page-break-after: avoid;"&gt;&lt;span style=""&gt;&lt;v:shape id="Picture_x0020_1" spid="_x0000_i1029" type="#_x0000_t75" style="width: 468pt; height: 225.75pt; visibility: visible;"&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image002.png" title=""&gt; &lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoCaption" style="text-align: center;" align="center"&gt;Figure &lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-begin'"&gt;&lt;/span&gt;&lt;span style="'mso-spacerun:yes'"&gt; &lt;/span&gt;SEQ Figure \* ARABIC &lt;span style="'mso-element:"&gt;&lt;/span&gt;&lt;![endif]--&gt;&lt;span style=""&gt;2&lt;/span&gt;&lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-end'"&gt;&lt;/span&gt;&lt;![endif]--&gt;: Joomla framework from joomla.org&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Kiến trúc module có thể mở rộng để áp dụng ở mức hệ thống và các module có thể là các ứng dùng hay service chạy song song và tương tác với nhau thông qua một kiểu giao tiếp nào đó như Messaging, RPC, Socket, file…&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Về mặt ý tưởng, kiến trúc module có thể xem là nền tảng cơ bản của rất nhiều kiến trúc tiên tiến khác nhu MVC, Multi-tier, SOA... Hơn nữa, kiến trúc module có thể tái áp dụng vào các module của chính nó hay các thành phần con của các kiến trúc trên như các service bên trong các hệ thống SOA.&lt;/p&gt;  &lt;h1&gt;Interface – công cụ giao tiếp của các module&lt;/h1&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Các module được gắn kết với nhau trong chương trình thông qua các “interface”. Một interface của module mô tả những thành phần được cung cấp và cần được cung cấp của module. Các thành phần này này được các module khác thấy và sử dụng.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Lưu ý là khái niệm interface ở đây khác biệt với khái niệm “interface” của các ngôn ngữ như Java, C#. Các interface của các module thường được thiết kế theo tiêu chí sao cho các quan hệ phụ thuộc giữa các module là nhỏ nhất có thể.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Để hoàn thiện khái niệm interface, David Parnas – người đi tiên phong về lĩnh vực kiến trúc phần mềm – đã đưa ra khái niệm Information-hidding. Khái niệm này đã được dùng như nền tảng cơ bản cho những nghiên cứu sau này.&lt;/p&gt;  &lt;h1&gt;Information-hiding (Parnas)&lt;/h1&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;&lt;span style=""&gt;Information hiding là khái niệm đóng gói và ẩn đi những thiết kế của chương trình mà chúng hầu như sẽ thay đổi. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;&lt;span style=""&gt;Trong kiến trúc module, theo nguyên lý Information-hiding, do những phần có khả năng thay đổi bên trong của module đã được ẩn đi nên những phần còn lại dùng để giao tiếp giữa các module sẽ không bị ảnh hưởng khi thay đổi thiết kế. Kết quả là những module có thể thay đổi một cách độc lập mà không ảnh hưởng lẫn nhau. Ví dụ, khi chúng ta muốn xây dựng một ứng dụng mà hỗ trợ nhiều cách lưu trữ dữ liệu khác nhau, thậm chí có thể mở rộng bổ sung trong tương lai thì cách tốt nhất là ẩn đi những xử ly lưu trữ cụ thể và chỉ dùng một giao diện chung đơn giản cho chúng. Như vậy theo Parmas, interface của module nên được thiết kế chỉ bao gồm những phần hầu như không thay đổi, những thành phần này được gọi là thành phần “công khai”. Còn những chi tiết ẩn dấu bên trong bởi interface thường được gọi là các thành phần “bí mật” hoặc “riêng tư”.&lt;/span&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_mPLw4KFyxU0/StACwaSDxwI/AAAAAAAAABM/b_N-0Uivoik/s1600-h/Modular3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 315px; height: 183px;" src="http://3.bp.blogspot.com/_mPLw4KFyxU0/StACwaSDxwI/AAAAAAAAABM/b_N-0Uivoik/s400/Modular3.png" alt="" id="BLOGGER_PHOTO_ID_5390811784674526978" border="0" /&gt;&lt;/a&gt;&lt;p class="MsoListParagraph" style="margin-left: 20.25pt; text-align: center; page-break-after: avoid;" align="center"&gt;&lt;span style=""&gt;&lt;v:shape id="Picture_x0020_11" spid="_x0000_i1028" type="#_x0000_t75" alt="tang bang.gif" style="width: 201.75pt; height: 156.75pt; visibility: visible;"&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image003.gif" title="tang bang"&gt; &lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoCaption" style="text-align: center;" align="center"&gt;Figure &lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-begin'"&gt;&lt;/span&gt;&lt;span style="'mso-spacerun:yes'"&gt; &lt;/span&gt;SEQ Figure \* ARABIC &lt;span style="'mso-element:"&gt;&lt;/span&gt;&lt;![endif]--&gt;&lt;span style=""&gt;3&lt;/span&gt;&lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-end'"&gt;&lt;/span&gt;&lt;![endif]--&gt; : Một module giống như một tảng băng có bề nổi là interface của chính nó&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;&lt;span style=""&gt;Trong .Net framework, những thành phần bí mật được sử dụng nội bộ bên trong các lớp thư viện của framework được khai báo bằng từ khóa “Internal”. Các thành phần “internal” của .Net không thể truy cập trực tiếp từ bên ngoài assembly của chúng cho dù chúng ta biết rõ mô tả của chúng. Tuy nhiên, trong một số trường hợp chúng ta muốn sử dụng một số tính năng cấp thấp hoặc sửa lỗi của framework nên buộc phải truy cập vào các thành phần này, một kĩ thuật thường dùng là Reflection.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Trong các mẫu lập trình (pattern), có một mẫu được tổ chức theo tư tưởng trên và được dùng rất phổ biến, đó là Façade pattern.&lt;/p&gt;  &lt;h1&gt;Façade pattern&lt;/h1&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in; line-height: normal;"&gt;&lt;span style=""&gt;Façade pattern là một mẫu thiết kế lập trình thường được dùng trong lập trình hướng đối tượng. Một façade là một object cung cấp một giao diện đơn giản ra bên ngoài cho một phần code lớn hơn như là các lớp thư viện bên trong. Một façade có thể:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0.0001pt 56.25pt; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;o&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Làm cho một thư viện phần mềm dễ dàng hiểu và dễ sử dụng hơn vì façade cung cấp phương tiện đơn giản hơn để truy cập những tác vụ thông thường (thay vì thao tác qua nhiều lớp thư việc phức tạp).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0.0001pt 56.25pt; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;o&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Giảm sự phụ thuộc giữa code bên ngoài và code thực thi bên trong thư viện, vì thế cho phép phát triển hệ thống một cách mềm dẻo hơn.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0.0001pt 56.25pt; text-indent: -0.25in; line-height: normal;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;o&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Được dùng như một cách để gói gọn một tập hợp API có sẵn được tổ chức không tốt bằng một tập API đơn giản hơn nhiều để phục vụ cho một vài tác vụ nhất định.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0.0001pt 56.25pt; text-indent: -0.25in; line-height: normal;"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0.0001pt 56.25pt; text-indent: -0.25in; line-height: normal;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_mPLw4KFyxU0/StAC8j2lcZI/AAAAAAAAABU/oPmnJxOg1J4/s1600-h/Modular4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 197px;" src="http://2.bp.blogspot.com/_mPLw4KFyxU0/StAC8j2lcZI/AAAAAAAAABU/oPmnJxOg1J4/s400/Modular4.png" alt="" id="BLOGGER_PHOTO_ID_5390811993402077586" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0.0001pt 56.25pt; text-indent: -0.25in; line-height: normal;"&gt;&lt;br /&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0.0001pt 56.25pt; line-height: normal;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" style="margin: 0in 0in 0.0001pt 20.25pt; text-align: center; line-height: normal; page-break-after: avoid;" align="center"&gt;&lt;span style=""&gt;&lt;v:shape id="Picture_x0020_3" spid="_x0000_i1027" type="#_x0000_t75" alt="Drawing5.gif" style="width: 286.5pt; height: 153pt; visibility: visible;"&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image004.gif" title="Drawing5"&gt; &lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoCaption" style="text-align: center;" align="center"&gt;Figure &lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-begin'"&gt;&lt;/span&gt;&lt;span style="'mso-spacerun:yes'"&gt; &lt;/span&gt;SEQ Figure \* ARABIC &lt;span style="'mso-element:"&gt;&lt;/span&gt;&lt;![endif]--&gt;&lt;span style=""&gt;4&lt;/span&gt;&lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-end'"&gt;&lt;/span&gt;&lt;![endif]--&gt; : Một ví dụ về Facade pattern&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraph" style="margin: 0in 0in 0.0001pt 20.25pt; line-height: normal;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 20.25pt; line-height: normal;"&gt;&lt;span style=""&gt;Façade pattern thường kết hợp với Singleton pattern để tố chức lớp façade theo dạng singleton. Ngoài ra, Façade pattern đặc biệt phù hợp trong mô hình 3-tier qua cách định nghĩa các giao tiếp đơn giản để tương tác giữa các tier, nhờ đó ẩn đi các xử lý phức tạp nội bộ bên trong. Nó còn được áp dụng rất phổ biến trong .NET Framework theo mô hình thiết kế component-oriented. Một trong những façade thường được sử dụng trong .NET 2.0 là “System.Web.Mail.SmtpMail”. Lớp này cung cấp cho người dùng một giao tiếp đơn giản để gửi mail thông qua giao thức Smtp mà không phải quan tâm đến các thao tác xử lý phức tạp bên trong.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 20.25pt; line-height: normal;"&gt;&lt;span style=""&gt;Tuy nhiên, việc sử dụng các lớp façade trong một thư viện cần được xem xét cẩn thận. Vì các façade, bản thân chúng, cung cấp một giao tiếp ở mức cao cho những chi tiết bên trong nên nếu không được thiết kế tốt, chúng sẽ hạn chế những tính năng của thư viện khi người dùng không thể truy cập đến những chi tiết ở mức thấp bị ẩn đi.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraph" style="margin: 0in 0in 0.0001pt 20.25pt; line-height: normal;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h1&gt;Inversion of control &lt;/h1&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;&lt;span style=""&gt;Inversion of Control, hay &lt;span style=""&gt; &lt;/span&gt;IoC, là một nguyên lý thuộc lĩnh vực thiết kế kiến trúc phần mềm trong đó mô tả luồng điều khiển của hệ thống bị đảo ngược so với kiến trúc cổ điển.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Theo mô hình lập trình cổ điển, lập trình viên viết các xử lý và thủ tục gọi đến các thủ tục trong thư viện có sẵn, các thủ tục này có thể gọi đến một thủ tục khác ở một thư viện khác nhưng nó không bao giờ gọi trở lại những xử lý do người lập trình đó viết (chúng ta tạm gọi là thủ tục của người dùng – user procedures). Nhưng đối với IoC, điều này lại xảy ra. Kết quả này có thể đạt được bằng cách thư viện hay một framework định nghĩa cơ chế chung cho một loại vấn đề còn xử lý cụ thể thì sẽ do thủ tục của người dùng giải quyết. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Một ví dụ dễ thấy của IoC là sự thay đổi của mô hình lập trình giao diện. Theo mô hình console cổ điển thì giao diện ứng dụng được điều khiển bởi code của ứng dụng. Ví dụ, để giải một bài toán c=a+b thì ta cần lần lượt yêu cầu người dùng nhập a, b rồi hiện kết quả c. Tuy nhiên, với các framework lập trình hỗ trợ giao diện đồ họa mới như .NET, vòng lặp xử lý chính được framework cung cấp và chương trình cần viết chỉ việc cung cấp các thủ tục xử lý sự kiện cho các control tương ứng với các giá trị trên. Luồng xử lý chính của ứng dụng như thế đã tách khỏi chương trình và đi vào framework.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;IoC được sử dụng như một tính năng cơ bản trong các framework hỗ trợ lập trình mức cao (như Spring, Cairngorm, PureMVC…). Thay vì phải viết một chuỗi các xử lý và thủ tục được gọi một cách tuần tự, người sử dụng các framework này thường viết các xử lý để đáp ứng lại các event hoặc yêu cầu dữ liệu đặc trưng. Đây cũng là một hướng khác trong việc thiết kế phương tiện giao tiếp giữa các module so với kiểu cổ điển vì trong phương thức giao tiếp có sự tham gia điều phối của framework bên dưới. Dưới đây chúng ta sẽ khái quát ba trong số các khái niệm kế thừa từ IoC: data-binding, dependency injection và event-driven architecture.&lt;/p&gt;  &lt;h1&gt;Data-binding&lt;/h1&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Trở lại ví dụ chương trình giải bài toán c=a+b ở trên, nếu chúng ta sử dụng một công cụ bảng tính như Excel và gán công thức cho cellC là cellA + cellB thì khi giá trị cell A và B được cập nhật, giá trị cell C sẽ tự động được tính lại. Tính năng tự động đồng bộ dữ liệu khi có thay đổi như trên không phải là mới và xuất hiện nhiều trong các ngôn ngữ lập trình hiện nay với tên gọi là data-binding.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Theo kiểu lập trình thô sơ hơn mà chúng ta thường làm thì để đạt được khả năng trên, trong một ngôn ngữ lập trình như .NET, chúng ta sẽ bắt các sự kiện thay đổi của các control (cell A, cell B) và gọi lại thủ tục cập nhật cell C. Còn khi sử dụng kĩ thuật data-binding, một đối tượng quan sát (observer) được tạo ra để quan sát các thay đổi trên thuộc tính của đối tượng nguồn và tự động cập nhật thay đổi lên thuộc tính được đăng ký tương ứng của đối tượng đích. Để cài đặt cơ chế data-binding, Observer pattern thường được dùng để tạo đối tượng observer và thuộc tính của đối tượng đích thường được dùng ở dạng set property. Cơ chế kích hoạt của data-binding là cách sử dụng sự kiện (event). Khi có sự thay đổi trên thuộc tính đối tượng nguồn, một event sẽ được kích hoạt và gửi tới observer. Observer sau đó duyệt trong danh sách đăng ký của mình và kích hoạt lại biểu thức gán thuộc tính các đối tượng đích tương ứng.&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_mPLw4KFyxU0/StADZLOGF3I/AAAAAAAAABc/O9Gqjbj7vU4/s1600-h/Modular5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 96px;" src="http://1.bp.blogspot.com/_mPLw4KFyxU0/StADZLOGF3I/AAAAAAAAABc/O9Gqjbj7vU4/s400/Modular5.png" alt="" id="BLOGGER_PHOTO_ID_5390812485006006130" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;&lt;img src="file:///C:/Users/DAKURA%7E1.DAK/AppData/Local/Temp/moz-screenshot-1.png" alt="" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 2.25pt; text-align: center; page-break-after: avoid;" align="center"&gt;&lt;span style=""&gt;&lt;v:shape id="Picture_x0020_2" spid="_x0000_i1026" type="#_x0000_t75" alt="Data-binding.gif" style="width: 367.5pt; height: 75.75pt; visibility: visible;"&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image005.gif" title="Data-binding"&gt; &lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoCaption" style="text-align: center;" align="center"&gt;Figure &lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-begin'"&gt;&lt;/span&gt;&lt;span style="'mso-spacerun:yes'"&gt; &lt;/span&gt;SEQ Figure \* ARABIC &lt;span style="'mso-element:"&gt;&lt;/span&gt;&lt;![endif]--&gt;&lt;span style=""&gt;5&lt;/span&gt;&lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-end'"&gt;&lt;/span&gt;&lt;![endif]--&gt; : Một ví dụ về mô hình data-binding&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Tính năng data-binding được hỗ trợ sẵn trong hầu hết các các framework lập trình hiện tại (như .NET, Flex…) và giúp lập trình viên giảm bớt rất nhiều thao tác xử lý so với cách xử lý thủ công. Hiện tại, data-binding ở các framework khác nhau cũng được hỗ trợ một số tính năng bổ sung khác nhau như khả năng binding 2 chiều, binding ngược từ đối tượng đích đến đối tượng nguồn… Nếu có dịp, chúng ta sẽ trao đổi thêm về tính năng này trong một bài viết khác. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Trở lại vấn đề ứng dụng trong kiến trúc module thì chúng ta thấy data-binding có ứng dụng như thế nào? Data-binding có khả năng rất to lớn trong việc thay đổi cách tương tác của các thành phần giao diện với các thành phần đảm nhận xử lý logic và dữ liệu. Trong các mô hình như 3-tier hay MVC, khi sử dụng data-binding, các module presentation hay view có thể gửi và nhận các thay đổi từ các module khác một cách tự động nhờ xử lý của framework bên dưới và do đó giảm bớt sự phụ thuộc giữa các module. Một framework được xem là chuẩn và được sử dụng rộng rãi trong các dự án lớn hiện nay là Cairngorm (xây dựng trên nền tảng Flex của Adobe theo mô hình MVC) cũng sử dụng data-binding như là phương tiện duy nhất để thao tác tới các các thành phần view.&lt;/p&gt;  &lt;h1&gt;Dependency injection&lt;/h1&gt;  &lt;p class="MsoNormal" style="text-indent: 20.25pt;"&gt;Được xem như một khái niệm điển hình kế thừa từ IoC, dependency injection thường được ứng dụng như một pattern mạnh mẽ trong việc hạn chế sự phụ thuộc giữa các object hay các module. &lt;/p&gt;  &lt;p style="text-indent: 20.25pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"  &gt;&lt;span style="font-size:100%;"&gt;Trong một ứng dụng, giả sử B là một lớp dịch vụ được tổ chức ở mức trừu tượng – abstract, ví dụ như hỗ trợ lưu trữ ảnh, và có nhiều lớp cụ thể kế thừa từ nó như lưu trữ vào database, lưu trữ file jpg, png, … Thông thường, nếu một thành phần A (client) cần truy cập đến một dịch vụ cụ thể của B thì A thường hoặc phải nắm giữ tham chiếu trực tiếp đến đối tượng con cụ thể hoặc thông qua một đối tượng trung gian nào đó để lấy tham chiếu đến nó. Bằng cách sử dụng cách truy cập thông qua đối tượng trung gian, chúng ta có tăng tính tái sử dụng A trong nhiều trường hợp bằng cách kết hợp nó với nhiều dạng lưu trữ khác nhau. Tuy nhiên theo cách này thì A vẫn bị giới hạn là phải biết đến đối tượng trung gian cũng như cách truy cập một dịch vụ cụ thể của B từ nó. Nhưng đối với dependency injection, A đơn giản là chỉ cần cung cấp một thuộc tính dùng để chứa tham chiếu và một khi một đối tượng A cụ thể được tạo ra, một dịch vụ cụ thể của B cũng sẽ được tự động tạo ra và gắn vào tham chiếu này thông qua một cơ chế bên ngoài.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 20.25pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:100%;"  &gt;Dependency injection được ứng dụng rộng rãi trong các framework trên nền tảng Java và .NET như Spring, PicoContainer, Spring.NET, Castle MicroKernel/Windsor… hay trong Flex như Mate, Swiz… Các framework này hầu hết đều hỗ trợ cấu hình các liên kết thông qua file config nên càng tăng tính tiện dụng. Đi sâu chi tiết vào dependency injection nằm ngoài mục tiêu của bài viết này và sẽ được trình bày ở một bài viết khác, tuy nhiên, nếu bạn quan tâm đến dependency injection thì hãy chọn một framework hỗ trợ mô hình này ở ngôn ngữ mình yêu thích và học cách sử dụng nó để thấy ứng dụng to lớn của dependency injection. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h1&gt;&lt;span style="font-size:100%;"&gt;Event-driven architecture&lt;/span&gt;&lt;/h1&gt;  &lt;p style="text-indent: 20.25pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:100%;"  &gt;Event-driven architecture (EDA) là mẫu kiến trúc phần mềm (architecture software pattern) trong đó, về cơ bản, hệ thống được xây dựng xung quanh các thao tác như tạo, khám phá, tiêu thụ và đáp trả lại các sự kiện (event). Hiểu đơn giản hơn, EDA là một dạng kiến trúc phần mềm được xây dựng trên luồng các event, sử dụng event như là phương tiện giao tiếp giữa các thành phần hệ thống.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 20.25pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:100%;"  &gt;Một event trong EDA được hiểu là một “thay đổi trạng thái đáng chú ý” của một thành phần nào đó. Event có thể được phát sinh do người dùng, do các thiết bị phần cứng hoặc do chính phần mềm phát sinh trong một điều kiện nào đó. EDA được xem như một trong những kĩ thuật thiết kế hiệu quả nhất trong việc hạn chế đến mức nhỏ nhất quan hệ phụ thuộc giữa các thành phần hệ thống hay các module. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 20.25pt;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"  &gt;&lt;span style="font-size:100%;"&gt;Một ví dụ đơn giản của EDA: một module quản lý việc đăng nhập của user cần chứng thực thông tin của user vừa nhập xong nên tự phát sinh và gửi đi một event gọi là LoginEvent chứa thông tin user. Event này sau đó được một module có khả năng thao tác với dữ liệu như WebServer, Database… bắt lấy, thực hiện việc kiểm chứng và sau đó trả lời kết quả thông qua LoginResultEvent để module đăng nhập bắt lấy. Theo cách xử lý này thì module đăng nhập&lt;/span&gt;&lt;span style="font-size:100%;"&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;không cần biết module nào và sẽ làm thế nào để thực hiện việc kiểm tra, nó chỉ cần biết gửi yêu cầu và nhận kết quả sau khi kiểm tra và tất cả những gì nó quan tâm chỉ là các event được định nghĩa ở mức hệ thống. Hơn nữa, event kết quả trong trường hợp trên có thể được quan tâm bởi nhiều module khác như module đảm nhận ghi log và do đó làm cho hệ thống càng mềm dẻo hơn.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-indent: 20.25pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_mPLw4KFyxU0/StAEBc0x5EI/AAAAAAAAABk/2xZ1IDT9FoM/s1600-h/Modular6.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 111px;" src="http://1.bp.blogspot.com/_mPLw4KFyxU0/StAEBc0x5EI/AAAAAAAAABk/2xZ1IDT9FoM/s400/Modular6.png" alt="" id="BLOGGER_PHOTO_ID_5390813176926430274" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-left: 20.25pt; page-break-after: avoid;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"  &gt;&lt;v:shape id="Picture_x0020_5" spid="_x0000_i1025" type="#_x0000_t75" alt="Drawing1.gif" style="width: 474pt; height: 126.75pt; visibility: visible;"&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image006.gif" title="Drawing1"&gt; &lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoCaption" style="text-align: center;" align="center"&gt;Figure &lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-begin'"&gt;&lt;/span&gt;&lt;span style="'mso-spacerun:yes'"&gt; &lt;/span&gt;SEQ Figure \* ARABIC &lt;span style="'mso-element:"&gt;&lt;/span&gt;&lt;![endif]--&gt;&lt;span style=""&gt;6&lt;/span&gt;&lt;!--[if supportFields]&gt;&lt;span style="'mso-element:field-end'"&gt;&lt;/span&gt;&lt;![endif]--&gt; : Một ví dụ đơn giản về EDA&lt;span style="font-size:11pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:11pt;"  &gt;&lt;span style="font-size:100%;"&gt;EDA là mẫu kiến trúc được ứng dụng cực kì rộng rãi trong các hệ thống hiện đại và đặc biệt được dùng như phương tiện giao tiếp giữa các service trong các hệ thống Service-oriented architecture (SOA) kiểu mới. EDA còn được sử dụng rộng rãi trong các framework phổ biến như Cairngorm, PureMVC… Việc nghiên cứu sâu về EDA cũng như các mẫu kiến trúc khác sẽ được chúng ta bàn sâu hơn các bài viết khác.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h1&gt;Lời kết&lt;/h1&gt;  &lt;p class="MsoNormal"&gt;Qua bài viết này hi vọng các bạn có thể tìm thấy nhiều kiến thức hữu ích về kiến trúc module, đặc biệt là các kĩ thuật trong việc tạo interface giao tiếp. Ngoài việc giới thiệu chung về khá nhiều kĩ thuật, bài viết còn chú trọng đến ứng dụng các kĩ thuật này trong kiến trúc module nên hi vọng có thể giúp cả những bạn đã từng nghiên cứu chúng có thể tìm thấy cách ứng dụng khác cho những kiến thức mình đã biết. Còn rất nhiều vấn đề không được nhắc tới trong bài viết nhưng phương pháp chia nhỏ hệ thống thành các module, các nguyên lý thiết kế… Những vấn đề này hi vọng chúng ta sẽ có dịp bàn tới trong các bài viết khác.&lt;/p&gt;  &lt;h1&gt;Tài liệu tham khảo&lt;/h1&gt;  &lt;p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Bertrand Meyer, Object&lt;i style=""&gt;-Oriented software construction – Second edition&lt;/i&gt;.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;David Parnas, &lt;i style=""&gt;On the Criteria to Be Used in Decomposing Systems Into Modules&lt;/i&gt;.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Len Bass, Paul Clements, Rick Kazman, &lt;i&gt;Software Architecture in Practice, Second Edition&lt;/i&gt;.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Martin Flower, &lt;a href="http://www.martinfowler.com/articles/injection.html"&gt;Inversion of Control Containers and the Dependency Injection Pattern&lt;/a&gt;.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="http://docs.joomla.org/Framework"&gt;http://docs.joomla.org/Framework&lt;/a&gt;.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;6.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="http://en.wikipedia.org/wiki/"&gt;http://en.wikipedia.org/wiki/&lt;/a&gt;.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;7.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="http://msdn.microsoft.com/"&gt;http://msdn.microsoft.com&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2803760956637347555-1404043726030485127?l=dakurai.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dakurai.blogspot.com/feeds/1404043726030485127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dakurai.blogspot.com/2009/10/van-e-giao-tiep-trong-kien-truc-module.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2803760956637347555/posts/default/1404043726030485127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2803760956637347555/posts/default/1404043726030485127'/><link rel='alternate' type='text/html' href='http://dakurai.blogspot.com/2009/10/van-e-giao-tiep-trong-kien-truc-module.html' title='VẤN ĐỀ GIAO TIẾP TRONG KIẾN TRÚC MODULE'/><author><name>Vo Hong Vinh</name><uri>http://www.blogger.com/profile/08085515550482870323</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_mPLw4KFyxU0/StACKfBnaRI/AAAAAAAAAA8/00ZB2qwVk1s/s72-c/Modular1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2803760956637347555.post-4876226881462544646</id><published>2009-10-09T20:12:00.000-07:00</published><updated>2010-09-13T09:46:30.985-07:00</updated><title type='text'>ỨNG DỤNG KIẾN TRÚC MODEL-VIEW-PRESENTER TRONG .NET</title><content type='html'>&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:officedocumentsettings&gt;   &lt;o:relyonvml/&gt;   &lt;o:allowpng/&gt;  &lt;/o:OfficeDocumentSettings&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face  {font-family:Wingdings;  panose-1:5 0 0 0 0 0 0 0 0 0;  mso-font-charset:2;  mso-generic-font-family:auto;  mso-font-pitch:variable;  mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face  {font-family:"Cambria Math";  panose-1:2 4 5 3 5 4 6 3 2 4;  mso-font-charset:1;  mso-generic-font-family:roman;  mso-font-format:other;  mso-font-pitch:variable;  mso-font-signature:0 0 0 0 0 0;} @font-face  {font-family:Calibri;  panose-1:2 15 5 2 2 2 4 3 2 4;  mso-font-charset:0;  mso-generic-font-family:swiss;  mso-font-pitch:variable;  mso-font-signature:-520092929 1073786111 9 0 415 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal  {mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-parent:"";  margin-top:0in;  margin-right:0in;  margin-bottom:10.0pt;  margin-left:0in;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} h1  {mso-style-priority:9;  mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-link:"Heading 1 Char";  mso-style-next:Normal;  margin-top:24.0pt;  margin-right:0in;  margin-bottom:0in;  margin-left:0in;  margin-bottom:.0001pt;  line-height:115%;  mso-pagination:widow-orphan lines-together;  page-break-after:avoid;  mso-outline-level:1;  font-size:14.0pt;  font-family:"Times New Roman","serif";  mso-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:major-fareast;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:major-bidi;  color:#365F91;  mso-themecolor:accent1;  mso-themeshade:191;  mso-font-kerning:0pt;} h2  {mso-style-priority:9;  mso-style-qformat:yes;  mso-style-link:"Heading 2 Char";  mso-style-next:Normal;  margin-top:10.0pt;  margin-right:0in;  margin-bottom:0in;  margin-left:0in;  margin-bottom:.0001pt;  line-height:115%;  mso-pagination:widow-orphan lines-together;  page-break-after:avoid;  mso-outline-level:2;  font-size:13.0pt;  font-family:"Times New Roman","serif";  mso-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:major-fareast;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:major-bidi;  color:#4F81BD;  mso-themecolor:accent1;} a:link, span.MsoHyperlink  {mso-style-priority:99;  color:blue;  mso-themecolor:hyperlink;  text-decoration:underline;  text-underline:single;} a:visited, span.MsoHyperlinkFollowed  {mso-style-noshow:yes;  mso-style-priority:99;  color:purple;  mso-themecolor:followedhyperlink;  text-decoration:underline;  text-underline:single;} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph  {mso-style-priority:34;  mso-style-unhide:no;  mso-style-qformat:yes;  margin-top:0in;  margin-right:0in;  margin-bottom:10.0pt;  margin-left:.5in;  mso-add-space:auto;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst  {mso-style-priority:34;  mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-type:export-only;  margin-top:0in;  margin-right:0in;  margin-bottom:0in;  margin-left:.5in;  margin-bottom:.0001pt;  mso-add-space:auto;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle  {mso-style-priority:34;  mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-type:export-only;  margin-top:0in;  margin-right:0in;  margin-bottom:0in;  margin-left:.5in;  margin-bottom:.0001pt;  mso-add-space:auto;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast  {mso-style-priority:34;  mso-style-unhide:no;  mso-style-qformat:yes;  mso-style-type:export-only;  margin-top:0in;  margin-right:0in;  margin-bottom:10.0pt;  margin-left:.5in;  mso-add-space:auto;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Arial","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} span.Heading1Char  {mso-style-name:"Heading 1 Char";  mso-style-priority:9;  mso-style-unhide:no;  mso-style-locked:yes;  mso-style-link:"Heading 1";  mso-ansi-font-size:14.0pt;  mso-bidi-font-size:14.0pt;  font-family:"Times New Roman","serif";  mso-ascii-font-family:"Times New Roman";  mso-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:major-fareast;  mso-hansi-font-family:"Times New Roman";  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:major-bidi;  color:#365F91;  mso-themecolor:accent1;  mso-themeshade:191;  font-weight:bold;} span.Heading2Char  {mso-style-name:"Heading 2 Char";  mso-style-priority:9;  mso-style-unhide:no;  mso-style-locked:yes;  mso-style-link:"Heading 2";  mso-ansi-font-size:13.0pt;  mso-bidi-font-size:13.0pt;  font-family:"Times New Roman","serif";  mso-ascii-font-family:"Times New Roman";  mso-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:major-fareast;  mso-hansi-font-family:"Times New Roman";  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:major-bidi;  color:#4F81BD;  mso-themecolor:accent1;  font-weight:bold;} .MsoChpDefault  {mso-style-type:export-only;  mso-default-props:yes;  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} .MsoPapDefault  {mso-style-type:export-only;  margin-bottom:10.0pt;  line-height:115%;} @page Section1  {size:8.5in 11.0in;  margin:1.0in 1.0in 1.0in 1.0in;  mso-header-margin:.5in;  mso-footer-margin:.5in;  mso-paper-source:0;} div.Section1  {page:Section1;}  /* List Definitions */  @list l0  {mso-list-id:721757342;  mso-list-type:hybrid;  mso-list-template-ids:-194982332 -630849386 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l0:level1  {mso-level-start-at:0;  mso-level-number-format:bullet;  mso-level-text:-;  mso-level-tab-stop:none;  mso-level-number-position:left;  text-indent:-.25in;  font-family:"Calibri","sans-serif";  mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;} @list l1  {mso-list-id:1214543772;  mso-list-type:hybrid;  mso-list-template-ids:-10443354 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l1:level1  {mso-level-tab-stop:none;  mso-level-number-position:left;  text-indent:-.25in;} ol  {margin-bottom:0in;} ul  {margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-qformat:yes;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin-top:0in;  mso-para-margin-right:0in;  mso-para-margin-bottom:10.0pt;  mso-para-margin-left:0in;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Calibri","sans-serif";  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;h1&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Đây là bài viết gốc trước khi được điều chỉnh để đăng trên PC World Vietnam.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/h1&gt;&lt;h1&gt;Vấn đề của các hệ thống tương tác &lt;/h1&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Trong các nền tảng lập trình hiện đại như .NET, khi mà các công cụ và kĩ thuật hỗ trợ lập trình giao diện người dùng (UI) ngày càng trở nên mạnh mẽ và tiện dụng thì chúng ta thường có xu hướng đưa nhiều xử lý bên ngoài vào các lớp UI.&lt;span style=""&gt;  &lt;/span&gt;Kết quả là các thành phần UI này chứa nhiều xử lý logic và dữ liệu mà lẽ ra nên tách rời thành những thành phần riêng. Việc tách rời xử lý và trình bày vì những lí do sau:&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;-&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Trong một hệ thống, UI là thành phần có nhiều khả năng thay đổi nhất nên việc tách rời các thành phần UI giúp có thể thay đổi các thành phần UI này một cách độc lập mà không ảnh hưởng đến các thành phần xử lý khác. Đặc biệt việc tách rời các thành phần dữ liệu khỏi UI còn cho phép trên cùng một thành phần dữ liệu này, ta có thể phát triển nhiều thành phần UI khác nhau cho các cách trình bày khác nhau.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;-&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Các code xử lý đặt trong các thành phần UI còn gây khó khăn cho việc testing (unit-test). &lt;span style=""&gt; &lt;/span&gt;Việc test các thành phần UI thường hoặc phải chạy ứng dụng thủ công hoặc sử dụng các runner script để thực hiện việc tương tác tự động lên các thành phần UI, do đó sẽ tốn nhiều chi phí và thời gian hơn để kiểm tra các xử lý bên trong các thành phần này. &lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;-&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Việc đưa nhiều xử lý vào các lớp UI còn dẫn đến khả năng là trùng lắp code xử lý. Những xử lý lẽ ra có thể dùng chung thì lại xuất hiện lặp lại ở nhiều thành phần UI có chức năng tương tự nhau. Việc tách các xử lý này ra ngoài ra còn tăng tính tái sử dụng code và dễ bảo trì hơn.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Các vấn đề trên là các vấn đề cơ bản được đặt ra cho các hệ thống tương tác (interactive system). Để giải quyết chúng, một số giải pháp được đề ra trong đó phổ biến nhất là mẫu kiến trúc MVC (Model-View-Controller). Trong bài viết này, chúng ta sẽ khảo sát mẫu kiến trúc MVC cổ điển và một mẫu kiến trúc thừa kế từ nó, hiện được ứng dụng rộng rãi trong môi trường .NET, đó là kiến trúc Model-View-Presenter.&lt;/p&gt;  &lt;h1&gt;Mẫu kiến trúc Model-View-Controller cổ điển&lt;/h1&gt;  &lt;h2&gt;Tổng quan&lt;/h2&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Mẫu kiến trúc Model-View-Controller là phương pháp chia nhỏ các các thành phần dữ liệu (data), trình bày (output) và dữ liệu nhập từ người dùng (input) thành những thành phần riêng biệt.&lt;/p&gt;  &lt;h2&gt;Lịch sử&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;MVC được hình thành bởi các nghiên cứu của Trygve Reenskaug vào khoảng các năm 1978-1979. Sau đó nó được điều chỉnh và được cài đặt lần đầu tiên vào các lớp của thư viện Xerox PARC Smalltalk-80. MVC cổ điển hiện tại ít được sử dụng trong môi trường lập trình desktop như trước đây nhưng hiện tại nó vẫn được sử dụng cực kì rộng rãi như là kiến trúc cơ bản trong các môi trường lập trình web.&lt;/p&gt;  &lt;h2&gt;Cấu trúc&lt;/h2&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_mPLw4KFyxU0/Ss_8xhOwcLI/AAAAAAAAAAM/oSD03yBNYe0/s1600-h/MVP1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 220px;" src="http://4.bp.blogspot.com/_mPLw4KFyxU0/Ss_8xhOwcLI/AAAAAAAAAAM/oSD03yBNYe0/s320/MVP1.png" alt="" id="BLOGGER_PHOTO_ID_5390805206649827506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:f&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/o:lock&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" style="width: 255pt; height: 189pt;" ole=""&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.emz" title=""&gt; &lt;/v:imagedata&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:oleobject type="Embed" progid="Visio.Drawing.11" shapeid="_x0000_i1025" drawaspect="Content" objectid="_1316674680"&gt;  &lt;/o:OLEObject&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;/v:shape&gt;&lt;/v:path&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;/p&gt;  &lt;h2&gt;Các thành phần&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Model chứa dữ liệu và các tính toán xử lý logic để giải quyết vấn đề mà phần mềm hướng tới (business logic). Thành phần model thường được trình bày ở dạng Domain Model .&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;View là thành phần đảm nhận trình bày từ những dữ liệu của Model. View bao gồm những gì thể hiện trên màn hình như các control, form, widget,…&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Controller là thành phần đảm nhận việc xử &lt;span style=""&gt; &lt;/span&gt;lý đáp trả lại các dữ liệu được đưa vào từ người dùng như các sự kiện chuột, bàn phím, các tương tác lên các control… Controller là cầu nối giữa người sử dụng và ứng dụng.&lt;/p&gt;  &lt;h2&gt;&lt;a name="_Toc175317064"&gt;Phối hợp các thành phần&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style=""&gt;Trong kiến trúc MVC, mỗi bộ ba Model-View-Controller được thiết kế tương ứng cho các đối tượng mà người dùng có thể tương tác. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style=""&gt;Model nắm giữ trạng thái, cấu trúc và các hành vi của dữ liệu được thể hiện và tương tác bởi người dùng. Model không phục thuộc và tương tác trực tiếp lên các thành phần khác. Thay vì vậy, khi có thay đổi, nó thông báo cho những thành phần như View tương ứng thông qua cơ chế là Observer pattern. Model còn cung cấp phương tiện để các thành phần khác tương tác lên nó.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style=""&gt;View lấy các thông tin từ Model và trình bày đến người dùng. Trên cùng một model, có thể có nhiều View cùng đăng ký. Khi có một thay đổi từ Model, tất cả các View đều được thông báo thông qua observer mà nó đã đăng ký.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style=""&gt;Mỗi View khi được tạo ra sẽ tạo ra một Controller đi kèm với nó. Trong khi các View đảm nhận kết xuất dữ liệu thì các Controller đảm nhận việc xử lý dữ liệu từ người dùng. Với mỗi sự kiện nhận được, Controller có thể xử lý và tương tác trực tiếp lên thành phần View và Model tương ứng để đáp trả. View và Controller là hai thành phần cấu thành nên giao diện người dùng của ứng dụng. Chúng lưu giữ liên kết trực tiếp đến Model. Trong khi Controller có thể thay đổi dữ liệu theo yêu cầu của người dùng thì View tương tác để lấy dữ liệu cập nhật vào chính nó từ Model.&lt;/span&gt;&lt;/p&gt;  &lt;h2&gt;&lt;span style=""&gt;Nhầm lẫn thường gặp&lt;/span&gt;&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Một nhầm lẫn thường gặp trong quan hệ giữa các thành phần MVC là khi xem mục đích của Controller như là thành phần trung gian để tách rời View khỏi Model. Trong khi thực tế, kiến trúc MVC tách rời dữ liệu và xử lý trung tâm khỏi phần trình bày thông qua cơ chế là Observer Pattern chứ không phải Controller. Nhiệm vụ của Controller là cần nối giữa người dùng là ứng dụng, không phải giữa View và Model.&lt;/p&gt;  &lt;h2&gt;Vấn đề của MVC&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Trong khi mục đích chính của MVC là tách rời trình bày và các xử lý bên trong. Việc phân rõ vai trò xử lý ouput (View) và input (Controller) là một hệ quả nhằm hoàn thiện cơ chế cho ý tưởng trên. Hiện nay trong nhiều môi trường lập trình hiện đại, nhiều control được cung cấp và hoàn thiện hơn (nhiều xử lý sự kiện cơ bản đã được hỗ trợ sẵn) so với trước đây nên việc khoáng tất cả các xử lý sự kiện cho một thành phần độc lập như Controller không còn là vấn đề quan trọng nữa.&lt;b style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.25in;"&gt;&lt;span style=""&gt; &lt;/span&gt;Trong khi đó, những cơ chế như Observer Pattern cũng có vấn đề của riêng chúng. Trong khi được dùng như phương tiện hiệu quả để loại bỏ sự phụ thuộc của Model vào các thành phần khác, nó có một vấn đề lớn là tại một thời điểm, chúng ta khó có thể xác định điều gì sẽ xảy ra bằng cách đọc code và việc thực hiện các testing cũng khó khăn hơn. Hơn nữa, do Model chỉ liên kết gián tiếp đến View thông qua Observer Pattern, khi sự thay đổi trạng thái của Model cần đến một vài thao tác xử lý phức tạp để áp dụng lên giao diện thì với mô hình cổ điển sẽ gặp khó khăn.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.25in;"&gt;Một vấn đề khác là chúng ta cần lưu trữ tình trạng hiện tại của UI (UI state), ví dụ trong danh sách sinh viên thì chúng ta cần biết sinh viên nào đang được chọn. Trong khi thành phần UI nắm giữ dữ liệu trình bày đang được chọn thì dữ liệu sinh viên thuộc về Model, như vậy dữ liệu về sinh viên được chọn sẽ được lưu trữ ở đâu khi cần truy xuất đến? &lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.25in;"&gt;Vì những lí do trên, MVC sau này đã có những thay đổi và bổ sung nhất định (như khái niệm Application Model). Kiến trúc MVP chúng ta sẽ bàn dưới đây cũng dựa trên tư tưởng cơ bản của MVC nhưng với cách tiếp cận khác nhằm mục đích khắc phục các khuyết điểm đã có.&lt;/p&gt;  &lt;h1&gt;Mẫu kiến trúc Dolphin Smalltalk Model-View-Presenter&lt;/h1&gt;  &lt;h2&gt;Tổng quan&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Mẫu kiến trúc Dolphin Smalltalk Model-View-Presenter chia ứng dụng thành các phần dữ liệu (data), trình bày (presentation) và các xử lý logic thuộc phần trình bày (presentation logic) thành những thành phần riêng biệt.&lt;/p&gt;  &lt;h2&gt;Lịch sử&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Phiên bản Dolphin Smalltalk Model-View-Presenter (gọi tắt là Dolphin MVP) là phiên bản của MVP được xây dựng&lt;span style=""&gt;  &lt;/span&gt;dựa trên phiên bản Taligent MVP xuất hiện trước đó. Dolphin MVP được xây dựng về cơ bản bên ngoài&lt;span style=""&gt;  &lt;/span&gt;tương tự như MVC cổ điển nhưng khác nhau ở vai trò của Controller và Presenter.&lt;/p&gt;  &lt;h2&gt;Cấu trúc&lt;/h2&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_mPLw4KFyxU0/Ss_9UW7Sw6I/AAAAAAAAAAU/r1-xJPRku6U/s1600-h/MVP2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 227px;" src="http://1.bp.blogspot.com/_mPLw4KFyxU0/Ss_9UW7Sw6I/AAAAAAAAAAU/r1-xJPRku6U/s320/MVP2.png" alt="" id="BLOGGER_PHOTO_ID_5390805805179257762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;v:shape id="_x0000_i1026" type="#_x0000_t75" style="width: 255pt; height: 189pt;" ole=""&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image002.emz" title=""&gt; &lt;/v:imagedata&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:oleobject type="Embed" progid="Visio.Drawing.11" shapeid="_x0000_i1026" drawaspect="Content" objectid="_1316674681"&gt;  &lt;/o:OLEObject&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;/v:shape&gt;&lt;/p&gt;  &lt;h2&gt;Các thành phần&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Model chứa dữ liệu và các tính toán xử lý logic để giải quyết vấn đề mà phần mềm hướng tới (business logic). &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;View là thành phần đảm nhận trình bày từ những dữ liệu của Model. View bao gồm những gì thể hiện trên màn hình như các control, form, widget,…&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Presenter là thành phần đảm nhận các xử lý về trình bày mà nó cần đến sự tương tác trên dữ liệu.&lt;/p&gt;  &lt;h2&gt;Phối hợp các thành phần&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Trong khi vai trò của Model không thay đổi so với MVC cổ điển. Thành phần View của Dolphin MVP cũng thực hiện việc trình bày từ nội dung của Model và gắn kết với Model thông qua Observer Pattern. Tuy nhiên, nó thực hiện bắt các sự kiện xảy ra ngay bên trong nó. Một vài trường hợp đơn giản như TextView, dữ liệu nhập được xử lý trực tiếp và cập nhật thay đổi trực tiếp vào Model còn hầu hết các trường hợp khác, việc xử lý được chuyển giao cho Presenter đảm trách khi cần thao tác đến Model.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Trong khi View đảm nhận trình bày thì Presenter đảm trách cách Model được thao tác và thay đổi như thế nào bởi giao diện người dùng. Presenter là nơi chứa các xử lý đặc trưng của ứng dụng (application logic so với business logic của Model). Một điểm đáng chú ý khác là Presenter có khả năng thao tác trực tiếp lên View mà nó gắn kết, điều này khác biệt với phiên bản Taligent MVP xuất hiện trước đó.&lt;/p&gt;  &lt;h2&gt;So sánh Dolphin MVP và MVC cổ điển&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Điểm khác biệt cơ bản của Dolphin MVP và MVC cổ điển là sự khác nhau về vai trò của Presenter và Controller, nó cũng dẫn đến sự khác nhau về vai trò giữa hai thành phần View. Trong Dolphin MVP, sự hiện diện của Controller bị loại bỏ, thay vào đó, việc xử lý các dữ liệu input được View đảm nhận và được chuyển cho Presenter khi có yêu cầu tương tác đến Model. &lt;/p&gt;  &lt;h1&gt;Mẫu kiến trúc MVP của Martin Fowler&lt;/h1&gt;  &lt;h2&gt;Tóm tắt&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Martin Fowler là một trong những người đâu tiên đi sâu và nghiên cứu về các phiên bản của MVP. Vào năm 2006, Fowler tuyên bố sự kết thúc của các kiến trúc MVP cổ điển và tự chia MVP thành hai phiên bản mới là Passive View và Supervising Controller.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_mPLw4KFyxU0/Ss_92CzgYQI/AAAAAAAAAAk/h8-c1lxfNlY/s1600-h/MVP3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 165px;" src="http://2.bp.blogspot.com/_mPLw4KFyxU0/Ss_92CzgYQI/AAAAAAAAAAk/h8-c1lxfNlY/s400/MVP3.png" alt="" id="BLOGGER_PHOTO_ID_5390806383893438722" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;v:shape id="_x0000_i1027" type="#_x0000_t75" style="width: 468pt; height: 195pt;" ole=""&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image003.emz" title=""&gt; &lt;/v:imagedata&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:oleobject type="Embed" progid="Visio.Drawing.11" shapeid="_x0000_i1027" drawaspect="Content" objectid="_1316674682"&gt;  &lt;/o:OLEObject&gt; &lt;/xml&gt;&lt;![endif]--&gt;(Martin Fowler dùng thuật ngữ Controller thay vì Presenter trong mẫu của mình)&lt;/v:shape&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Trong mẫu Passive View, thành phần View được loại bỏ hoàn toàn các xử lý logic và tương tác đến Model. Thay vì vậy, nó chuyển giao các xử lý cho Controller đảm trách. Controller đảm nhận tương tác đến Model và cập nhật View khi có thay đổi từ Model. Controller là thành phần trung gian liên lạc giữa View và Model.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Trong mẫu Supervising Controller, View đầu tiên bắt lấy các sự kiện và sau đó chuyển giao cho controller xử lý. Để cập nhật thay đổi từ Model, View dùng data-binding và Observer pattern cho các xử lý đơn giản còn đối với các xử lý phức tạp sẽ nhờ đến Controller đảm nhận.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;So với Supervising Controller chứa View đảm nhận xử lý sự kiện đơn giản thì với Passive View, thành phần View được tách rời hoàn toàn khỏi các xử lý, kể cả các xử lý cơ bản ở mức giao diện cũng được giao hoàn toàn cho Presenter xử lý. &lt;span style=""&gt; &lt;/span&gt;Điều này tạo thuận lợi hơn cho việc testing vì khi đó các thành phần Model và Presenter có thể được kiểm tra một cách độc lập mà không phụ thuộc vào giao diện. Phiên bản MVP của Microsoft&lt;span style=""&gt;  &lt;/span&gt;đầu tiên được xây dựng dựa trên Passive View sau đó mẫu Supervising Controller cũng được hỗ trợ với một số điều chỉnh.&lt;/p&gt;  &lt;h1&gt;Phiên bản MVP của Microsoft&lt;/h1&gt;  &lt;h2&gt;Lịch sử&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Khởi đầu từ các framework&lt;span style=""&gt;  &lt;/span&gt;Smart Client Software Factory and Web Client Software Factory dựa trên kiến trúc MVP được các nhóm nghiên cứu về pattern của Microsoft tạo ra từ năm 2006, Microsoft sau đó bắt đầu đưa MVP vào các tài liệu hướng dẫn và ví dụ về lập trình giao diện trong .NET framework. Mô tả dưới đây dựa trên phiên bản MVP được mô tả trong tạp chí MSDN vào năm 2006 (tham khảo 2) và có thể xem là kiến trúc cơ bản cho các framework trên. Ngoài ra, còn có một số framework MVP khác cũng được phát triển trên nền tảng .NET như MVC# hay NMVP.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Xin lưu ý là phiên bản cũ của Web Client Software Factory ban đầu được tổ chức dựa trên Passive View (cấu trúc bên dưới) nhưng với phiên bản hiện tại thì cấu trúc dựa trên Supervising Controller cũng được hỗ trợ.&lt;/p&gt;  &lt;h2&gt;Cấu trúc&lt;/h2&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_mPLw4KFyxU0/Ss_-iZenlZI/AAAAAAAAAAs/MWrjS1cKwtM/s1600-h/MVP4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 373px;" src="http://2.bp.blogspot.com/_mPLw4KFyxU0/Ss_-iZenlZI/AAAAAAAAAAs/MWrjS1cKwtM/s400/MVP4.png" alt="" id="BLOGGER_PHOTO_ID_5390807145894090130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;v:shape id="_x0000_i1028" type="#_x0000_t75" style="width: 313.5pt; height: 291pt;" ole=""&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image004.emz" title=""&gt; &lt;/v:imagedata&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:oleobject type="Embed" progid="Visio.Drawing.11" shapeid="_x0000_i1028" drawaspect="Content" objectid="_1316674683"&gt;  &lt;/o:OLEObject&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;/v:shape&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;h2&gt;Các thành phần&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Model chứa dữ liệu và các tính toán xử lý logic để giải quyết vấn đề mà phần mềm hướng tới (business logic). &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;View là thành phần đảm nhận trình bày từ những dữ liệu của Model và là tổng hợp của các form, control được sử dụng.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Presenter là thành phần đảm nhận các xử lý về trình bày &lt;span style=""&gt; &lt;/span&gt;cũng như tương tác đến dữ liệu bên dưới và có thể tương tác để thay đổi View trong quá trình xử lý.&lt;/p&gt;  &lt;h2&gt;Phối hợp các thành phần&lt;/h2&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Mẫu kiến trúc MVP của Microsoft tương tự như Passive View nhưng nó bổ sung thêm ràng buộc là các Presenter chỉ có thể truy cập đến View thông qua các interface IView. Điều này giúp Presenter không phụ thuộc đến cài đặt cụ thể của View và có thể dễ dàng test Presenter một cách độc lập. Điều này đạt được do sử dụng IView, chúng ta có thể dùng kĩ thuật “Mock” để thay thế các xử lý cụ thể của View khi test Presenter. Ngoài ra, mối quan hệ giữa Presenter và Model là quan hệ một chiều (chiều còn lại là gián tiếp).&lt;span style=""&gt;  &lt;/span&gt;Hệ quả của các liên kết là chúng ta có một mô hình đa lớp (multi-layer) như cấu trúc ở trên theo ý nghĩa các thành phần ở một layer chỉ phụ thuộc và sử dụng các thành phần ở layer ngay bên dưới nó.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Theo mẫu Microsoft MVP, khi một View gắn liền với một interface IView. Khi View được tạo ra, nó tạo ra một đối tượng private Presenter và gắn nó vào đối tượng này thông qua IView. Khi một sự kiện xảy ra, View bắt lấy &lt;span style=""&gt; &lt;/span&gt;và sau đó kích hoạt một phương thức của Presenter mà sau đó, nó có thể tương tác với Model. Một số sự kiện như bắt đầu hiển thị và đóng của View cũng được gửi tới để Presenter kích hoạt một số phương thức tương ứng, điều này giúp cho một số công việc như khởi tạo và giải phóng dữ liệu cho View được dễ dàng hơn.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Model theo Microsoft MVP cũng thường được tổ chức bổ sung một lớp Service nằm bên trên để tương tác với Presenter, qua đó giảm bớt sự phụ thuộc đến các xử lý data nằm sâu bên dưới. Ngoài ra, để điều khiển việc liên lạc giữa các View hay các Presenter, một thành phần thường được bổ sung gọi là Application Controller. Trong một ứng dụng có thể có nhiều Application Controller để quản lý các nhóm MVP. Ngoài ra, thay vì sử dụng Presenter để tương tác với Model, một cách là giao tất cả các thao tác này cho Application Controller đảm trách.&lt;/p&gt;  &lt;h2&gt;Một ví dụ minh họa đơn giản&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Để minh họa mẫu Microsoft MVP, chúng ta sẽ cùng khảo sát một ví dụ đơn giản: tạo một form hiển thị danh sách sinh viên cùng chức năng thêm mới trên danh sách sinh viên đó. Với mục tiêu là minh họa cách tổ chức và liên kết giữa các thành phần là chủ yếu, chúng ta không đi sâu vào cài đặt cụ thể (bạn có thể tham khảo source code đi kèm bài viết, source code được tổ chức ở dạng project của VS 2008).&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;span style=""&gt; &lt;/span&gt;Ứng dụng được tổ chức thành 5 project: View, Presenter, DataService, Model và DataTransferObject. Trong đó, View là application còn các project khác là library. Các project phụ thuộc lẫn nhau theo thứ tự project phía trước sử dụng trực tiếp project phía sau, ngoại trừ DataTransferObject chức các loại dữ liệu được dùng chung cho 3 project View, Preseneter và DataService. Model là project chứa các tương tác trực tiếp đến dữ liệu và không phụ thuộc vào bất cứ thành phần nào khác.&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_mPLw4KFyxU0/Ss_-5UGZjWI/AAAAAAAAAA0/aHsiSANHiIA/s1600-h/MVP5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 313px; height: 337px;" src="http://4.bp.blogspot.com/_mPLw4KFyxU0/Ss_-5UGZjWI/AAAAAAAAAA0/aHsiSANHiIA/s400/MVP5.png" alt="" id="BLOGGER_PHOTO_ID_5390807539587321186" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;v:shape id="_x0000_i1029" type="#_x0000_t75" style="width: 228pt; height: 250.5pt;" ole=""&gt;  &lt;v:imagedata src="file:///C:%5CUsers%5CDAKURA%7E1.DAK%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image005.emz" title=""&gt; &lt;/v:imagedata&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:oleobject type="Embed" progid="Visio.Drawing.11" shapeid="_x0000_i1029" drawaspect="Content" objectid="_1316674684"&gt;  &lt;/o:OLEObject&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;/v:shape&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-indent: 0.5in;"&gt;Giải thích các project:&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;-&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Model: chứa dữ liệu giả lập (StudentData.xml), schema&lt;span style=""&gt;  &lt;/span&gt;(StudentDataSet.xsd) và lớp tiện ích được xây dựng bên trên (DataAccess.cs).&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;-&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataTransferObject: chứa đối tượng dữ liệu được dùng chung cho các project ở mức cao hơn (Student.cs).&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;-&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataService: được xây dựng bên trên Model, chuyển đổi dữ liệu từ Model sang DataTransferObject và xây dựng các tiện ích bên trên đối tượng transfer này (Service.cs).&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;-&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Presenter: chứa interface của View dùng cho Presenter truy cập (IViewForm) và lớp Presenter (StudentPresenter).&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;-&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;View: chứa form view (ViewForm.cs) và Program.cs.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;Trong bài viết khác, chúng ta sẽ tìm hiểu phương pháp TDD (Test-driven development) và ứng dụng nó để phát triển ứng dụng theo mẫu Microsoft MVP trong môi trường .NET.&lt;/p&gt;  &lt;h2&gt;Tài liệu tham khảo&lt;/h2&gt;  &lt;p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Martin Fowler, GUI Architectures ,&lt;a href="http://www.martinfowler.com/eaaDev/uiArchs.html"&gt;http://www.martinfowler.com/eaaDev/uiArchs.html&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Jean-Paul Boodhoo , &lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:100%;"  &gt;Design Patterns: Model-View-Presenter, &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc188690.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/cc188690.aspx&lt;/a&gt; &lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Buschmann F., Meunier R., Rohnert H. &amp;amp; Sommerlad P. &amp;amp; Stal M. (1996). Pattern-Oriented Software Architecture: A System of Patterns.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Martin Fowler , Patterns of Enterprise Application Architecture.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="http://en.wikipedia.org/wiki/Model_View_Presenter"&gt;http://en.wikipedia.org/wiki/Model_View_Presenter&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;6.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller"&gt;http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;7.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Derek Greer, Interactive application architecture patterns,&lt;span style=""&gt;  &lt;/span&gt;&lt;a href="http://ctrl-shift-b.com/2007/08/interactive-application-architecture.html"&gt;http://ctrl-shift-b.com/2007/08/interactive-application-architecture.html&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;8.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Views Testability Guidance, &lt;a href="http://msdn.microsoft.com/en-us/library/cc304742.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc304742.aspx&lt;/a&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;9.&lt;span style=";font-family:&amp;quot;;font-size:7pt;"  &gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Dolphin MVP paper, http://www.object-arts.com/papers/TwistingTheTriad.PDF&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Mọi đóng góp và thắc mắc vui lòng gửi về địa chỉ &lt;a href="mailto:dakurai@gmail.com"&gt;dakurai@gmail.com&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2803760956637347555-4876226881462544646?l=dakurai.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dakurai.blogspot.com/feeds/4876226881462544646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dakurai.blogspot.com/2009/10/ung-dung-kien-truc-model-view-presenter.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2803760956637347555/posts/default/4876226881462544646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2803760956637347555/posts/default/4876226881462544646'/><link rel='alternate' type='text/html' href='http://dakurai.blogspot.com/2009/10/ung-dung-kien-truc-model-view-presenter.html' title='ỨNG DỤNG KIẾN TRÚC MODEL-VIEW-PRESENTER TRONG .NET'/><author><name>Vo Hong Vinh</name><uri>http://www.blogger.com/profile/08085515550482870323</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_mPLw4KFyxU0/Ss_8xhOwcLI/AAAAAAAAAAM/oSD03yBNYe0/s72-c/MVP1.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2803760956637347555.post-7222561430882044191</id><published>2009-06-05T00:47:00.000-07:00</published><updated>2009-06-09T02:51:18.818-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionScript'/><category scheme='http://www.blogger.com/atom/ns#' term='interface'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='OO languages'/><category scheme='http://www.blogger.com/atom/ns#' term='view'/><title type='text'>New wild idea in OOP</title><content type='html'>&lt;h1&gt;The beginning&lt;/h1&gt;A while ago, when designing a new framework, I have met some problems with the limit of current OO languages. Because it bases on the module architecture, I need a more flexible method to design and link the module to the main application. Currently, in .NET or Java, when we want to call a member from an unknown class type, we generally have to use Reflection. This method, itself, has many disadvantages.  In C# 4.0 coming soon, a new feature called dynamic type is introduced. It has some advantages over Reflection. In fact, the dynamic type isn’t new concept and has occurred in many languages such as ActionScript, Python, Ruby…  And it has potential to produce more error at runtime and has lower performance than static type. So may we need a new method?&lt;br /&gt;&lt;p&gt;In following sections, we will come through many situations which current concepts won’t provide good enough solutions. After that, I will introduce a new idea that may be worth to look. The languages are used in examples will be ActionScript and C# (these are my main development languages) but other OO languages could be similar.&lt;br /&gt;&lt;/p&gt;&lt;h1&gt;The situations&lt;br /&gt;&lt;/h1&gt;&lt;h2&gt;Situation 1:&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;We want to use an object but specific type of it is unknown, or rather dynamic type. Such a object could be created by some technique such as Reflection (or getClassFromName in ActionScript) or simply from a method which get object from external lib, module, COM, Ruby, Python,…We can use the methods of it by using invoke or simply convert it to dynamic type (C# 4.0 or ActionScript 3.0). Examples:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Invoke (C#)&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;object&lt;/span&gt; calc = GetCalculator();&lt;br /&gt;Type type = calc.GetType();&lt;br /&gt;&lt;span class="kwrd"&gt;object&lt;/span&gt; result = type.InvokeMember(&lt;span class="str"&gt;"Add"&lt;/span&gt;,&lt;br /&gt;BindingFlags.InvokeMethod, &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt;[] { 10, 20 });&lt;br /&gt;&lt;span class="kwrd"&gt;int&lt;/span&gt; sum = Convert.ToInt32(result);&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Dynamic type (C# 4.0)&lt;br /&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;dynamic calc = GetCalculator();&lt;br /&gt;&lt;span class="kwrd"&gt;int&lt;/span&gt; result = calc.Add(10, 20);&lt;/pre&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Dynamic type (ActionScript 3.0)&lt;br /&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;Object calc = GetCalculator();&lt;br /&gt;&lt;span class="kwrd"&gt;int&lt;/span&gt; result = calc.Add(10, 20);&lt;/pre&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;==&amp;gt; What disadvantages of these :&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Invoke technique in .NET is very powerful and it can even be used on non-public members. But it is a little complex to be used because it requires knowledge of reflection. And when you invoke a member, you have many exceptions to be aware of, because the name and arguments of member simply can’t be determined at compile- time. In many situations, you may need a simpler solution to call member of a specific type, so as, dynamic type in C# 4.0.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Dynamic type (C# 4.0 or ActionScript 3.0) is a simpler solution to this. But it still a big disadvantage: you can’t guarantee that what you give is valid and there isn’t a method to check a member fully before you actually work on it (you can still check name and maybe return type but checking arguments is a pain). So, you also need to catch exceptions if it happens. (Dynamic type is still a very useful when combined with other techniques such as data binding).&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;All these technique are considered slow when compared with static types.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Situation 2&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;We have 2 existing class CalculatorA and CalculatorB, it maybe come from different external libraries or modules. They share several methods such as Add, Subtract…which we want to use. Moreover, we want to support both of them and use them in the same code. Which class is used depends on situations. In general, if these classes both implement a specific interface or derive from a class which declares methods we need, it would be very easy. In contract, because they don’t , we have to use some techniques such as create a new wrapper which encapsulates both class or create wrappers which implement the same new interface for each class (or techniques in situations 1). These solutions need more work to do and maybe a little complex to use.&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Situation 3&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;This one is similar to Situation 2, but there is a difference: we don’t only use some the members shared between classes but other members not shared too. For examples, CalculatorA and CalculatorB are both create on the same specification in the beginning but each class has add some different features which are valuable to be used. We can assume that CalcuatorA is provided by company A and CalculatorB is provided by company B or maybe they are the same class which came from different versions of the same library. In general, we need to check which class is currently provided and call appropriate code upon it. Because we don’t know exactly which version will be used, we may want to use some technique in Situation 1 such as Reflection to do it. What will happen if we can define two new interfaces to use with these classes in our project (for an easier life) or if you prefer another simple solution, a single interface which can be use with both classes (in this case, we may need a tool to check whether a member is supported or not) ?&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Situation 4&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;This situation is very simple. We have a very large and complex class such as Graphics. It has many complex or annoying public members which I needn’t use. In fact, there are some interface can be used upon it but what we need is not included in one but several interfaces. So we can’t use it with a single and simple interface without creating another annoying wrapper?&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Situation 5&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;This situation is similar. When we build an application, we find out an interesting library. We notice there are an interface X and several classes implementing it in this library. We want to use them and even want to create some new implementations of interface X. But, in fact, we don’t want to use and implement all members of X. So, we create a new interface X1 which includes subset members and implement X1. What can we do if we want to use both old and new classes with interface X1? We may have some solutions such as creating a wrapper which wraps X and implement X1, but we may prefer a simple and straightforward solution. The solution that I mention is the ability converting directly from old class to X1.&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Situation 6&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;This situation extends Situation 5. When creating interface X1, we find out that it may be interesting if we add some new methods to X1. These extra methods may help in some situations but old classes implementing X are still useful. We want that if we use these classes and extra methods are missing, when we call them, something can be executed alternatively such as returning a predefined value, throwing a predefined exception, calling other methods of interface X1... This may be a little complex but very useful in many situations.&lt;br /&gt;&lt;/p&gt;&lt;h1&gt;The new concept – View&lt;br /&gt;&lt;/h1&gt;&lt;p&gt;In many OO languages, interface is an important concept. Interface concept derives from abstract class concept and provides a valuable benefit: supporting multiple inheritance. Because an interface only includes declarations of members, it can be used to separate declarations from the real implementations. We can use an interface to interact with an object without knowing its type of class, but rather only that it implements that interface. But there is a restriction, the word “implement” we use here means the class of the object must point out the interfaces implemented in its declaration. Personally, I think that it’s more natural if that class just needs implement all members which interface declares to meet the requirement. This restriction limit the usage of interface, the above situations are some examples of it. Even if we remove this restriction, the new interface won’t be good enough solutions for some situations (such as situation 6). So we may have to extend it a bit more.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I don’t want to mess with the interface concept so I create a new concept called “View”. A new “View” concept matches the interface concept basically but the new concept has some differences:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-          A method (and its extended concepts such as property, index…) now can have a default behavior added to its declaration in view. A default behavior will be used when we use view on an object that didn’t implement that method. A default behavior can be: return a default value, throws a specific exception, call a sibling method or call a static method…&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-          In contract to interface concept, a class needn’t point out the views in its declaration to show that it will implement them. An object can be converted to a view even if its class didn’t implement all members of that view. In case a member isn’t implemented, its specific behavior will be executed instead when it’s called. If that missing member doesn’t have default behavior, the convert task will be fail.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-          A view can inherits members from other views, base on interfaces and extract members from classed. It can add default behavior to members it got from them by using the fully qualified member name (Ex. IPaint.draw(),  Point.move()…).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;We can only call a member from a view if the view has declaration of it, so no more invalid member name or argument problems at runtime. If we convert a view holding a object to another type, all extra member won’t be considered.&lt;/p&gt;&lt;h2&gt;More definition of View&lt;/h2&gt;&lt;p&gt;After receiving some comments, I think that'll be more clearly to give more defifinition here.&lt;br /&gt;So what is a view?&lt;/p&gt;&lt;p&gt;Meanwhile a class encapsulates an entire entity type (the &lt;i&gt;state&lt;/i&gt; and &lt;i&gt;behavior&lt;/i&gt;),a view encapsulates the signatures (or declarations) of some behaviors sharing between entities. Those behaviors are what we want to use on those entities and when a behavior is missing on an entity, we could use the standard reaction of behavior instead. In some respect, it's similar to mask. Using a view on an object is similar to apply a mask on it.&lt;/p&gt;&lt;h2&gt;Comparison to Duck-typing&lt;/h2&gt;One of replies I received points out the similarity between my idea and a principle called duck-typing. You can read its definition here: &lt;a href="http://en.wikipedia.org/wiki/Duck_typing"&gt;http://en.wikipedia.org/wiki/Duck_typing&lt;/a&gt;.&lt;br /&gt;After reading about duck-typing from wiki link, I notice the phrase "in computer programming, duck typing is a style of dynamic typing..". In fact, duck-typing is more raw and powerful because it allow you convert a class to any compatible class or interface. I think it and dynamic type are the same, though it could check the compatibility before using : "With Duck Typing, in order to prevent strange, hard to detect errors, the developer needs to be aware of each potential use of the method 'press', even when it's conceptually unrelated to what he or she is working on".&lt;br /&gt;My idea is more restrict, may be derived from duck-typing interface, but the power is still remained fully. We use "view" when we need (instead of any compatible class or interface to be confused) and the compatibility is checked (fully) when converting. The view is similar to interface so it's more understandable when using than duck-typing: "In essence, the problem is that, 'if it walks like a duck and quacks like a duck', it could be a dragon doing a duck impersonation. You may not always want to let dragons into a pond, even if they can impersonate a duck". Human and monkey have some similar aspect but when you use monkey in place of human is something strange (hard to understand though it give you more power!).&lt;br /&gt;A question: How is my idea any different? Could a dragon still impersonate a duck my  suggestion? which means compromises type safety?&lt;br /&gt;According to my idea, a view is  a collection of behaviors's signatures, not a real entity type, those behaviors are what we want to use on an object if it has. In the "duck" example, we could define a view such as VDuckBehavior and use it to interact with some dragon if possible. Similarly, we may include some behaviors of human in a view (ex: viewX) that monkey also have (certainly they are not the same).&lt;br /&gt;As you see, although they are similar, their principle are different (A similar situation we all know: abstract class, interface and multi-inheritance, do you agree?).  Moreover, view have more features that may be useful, specially default behavior.&lt;br /&gt;Duck-typing and dynamic type could make a design difficult to understand if they're used. I don't have a clear interface definition so comparing view with duck-typing interface may be not obvious. But at least, a view has more clear meaning (interface is derived from abstract class) so it can be add more features such extracting behaviors from class and default behavior. The view concept and class concept are independent to each other. Meanwhile the interfaces are needed to exist before creating class, the view is generally created after that. Comparing to duck-typing, view is easier to understand and has not violate OO principles.&lt;br /&gt;If the future C# support duck-typing, basic programmer could have a hard time to understand it after learning about OOP and you could not add extra features from view concept (to make more complicated).&lt;br /&gt;&lt;h2&gt;Example view for C#&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;We have following classes and interfaces:&lt;/p&gt;&lt;p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; NewConcept.Examples&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;   interface&lt;/span&gt; ISimpleCalcuator&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;      int&lt;/span&gt; Add(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b);&lt;br /&gt;&lt;span class="kwrd"&gt;      int&lt;/span&gt; Subtract(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b);&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; NewConcept.Examples&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;   public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CalculatorA: ISimpleCalcuator&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; CalculatorA()&lt;br /&gt;   {&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;span class="preproc"&gt;      #region&lt;/span&gt; ISimpleCalcuator Members&lt;br /&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt; public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Add(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b)&lt;br /&gt;   {&lt;br /&gt;&lt;span class="kwrd"&gt;       return&lt;/span&gt; a + b;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Subtract(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b)&lt;br /&gt;   {&lt;br /&gt;      &lt;span class="kwrd"&gt;return&lt;/span&gt; a - b;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;span class="preproc"&gt;      #endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Multiply(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b)&lt;br /&gt;   {&lt;br /&gt;      &lt;span class="kwrd"&gt;return&lt;/span&gt; a * b;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;&lt;/span&gt;&lt;p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; NewConcept.Examples&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;   public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CalculatorB:ISimpleCalcuator&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; CalculatorB()&lt;br /&gt;   {&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;span class="preproc"&gt;      #region&lt;/span&gt; ISimpleCalcuator Members&lt;br /&gt;&lt;br /&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Add(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b)&lt;br /&gt;   {&lt;br /&gt;       &lt;span class="kwrd"&gt;return&lt;/span&gt; Math.Abs(a + b);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Subtract(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b)&lt;br /&gt;   {&lt;br /&gt;      &lt;span class="kwrd"&gt;return&lt;/span&gt; Math.Abs(a - b);&lt;br /&gt;   }&lt;br /&gt;  &lt;span class="preproc"&gt; #endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Divide(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b)&lt;br /&gt;   {&lt;br /&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt; (b == 0)&lt;br /&gt;          &lt;span class="kwrd"&gt;return&lt;/span&gt; 0;&lt;br /&gt;  &lt;span class="kwrd"&gt;    else&lt;/span&gt;&lt;br /&gt;          &lt;span class="kwrd"&gt;return&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt;)Math.Abs(a / b);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:monospace;"&gt;&lt;/span&gt;We have two classes implementing the same interface ISimpleCalculator. Each class also has its own method which didn’t declare in the interface. We want to use all the methods if possible so we create a new view.&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; NewConcept.Examples&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;   public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;view &lt;/span&gt;VCalculator &lt;span style="color: rgb(51, 51, 255);"&gt;bases on&lt;/span&gt; ISimpleCalculator&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;       int&lt;/span&gt; Divide(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b) &lt;span class="kwrd"&gt;default&lt;/span&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; 0;&lt;br /&gt;&lt;span class="kwrd"&gt;       int&lt;/span&gt; Multiple(&lt;span class="kwrd"&gt;int&lt;/span&gt; a, &lt;span class="kwrd"&gt;int&lt;/span&gt; b) &lt;span class="kwrd"&gt;default&lt;/span&gt; &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;"not support"&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The VCalculator view has declarations basing on ISimpleCalculator. It also add to more methods with default behavior. The first method will return 0 at default when the second will throws an exception. Then we may use it like this:&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;VCalculator viewA = &lt;span class="kwrd"&gt;new&lt;/span&gt; CalculatorA() &lt;span class="kwrd"&gt;as&lt;/span&gt; VCalculator;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (viewA != &lt;span class="kwrd"&gt;null&lt;/span&gt;) &lt;span class="rem"&gt;//convert sucessfully&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;    int&lt;/span&gt; c = viewA.Add(2, 3);&lt;br /&gt;&lt;span class="kwrd"&gt;    int&lt;/span&gt; d = viewA.Multiple(2, 3);&lt;br /&gt;}&lt;br /&gt;VCalculator viewB = &lt;span class="kwrd"&gt;new&lt;/span&gt; CalculatorB() &lt;span class="kwrd"&gt;as&lt;/span&gt; VCalculator;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (viewB != &lt;span class="kwrd"&gt;null&lt;/span&gt;) &lt;span class="rem"&gt;//convert sucessfully&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;   int&lt;/span&gt; c = viewB.Add(2, 3);&lt;br /&gt;&lt;span class="kwrd"&gt;   int&lt;/span&gt; d = viewB.Divide(2, 3);&lt;br /&gt;}&lt;/pre&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The VCalculator can be converted from either CalculatorA or CalculatorB instances. After the conversion, the view can be used easily with some notices to methods which have default behavior.&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Example view for ActionScript&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;We use the same classes as above but implemented in ActionScript. First is a simple interface two following classes implement it.&lt;/p&gt;&lt;p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;package &lt;span style="color: rgb(0, 0, 0);"&gt;Examples&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; ISimpleCalculator&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       function &lt;/span&gt;Add(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       function &lt;/span&gt;Subtract(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;package &lt;/span&gt;Examples&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;   public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CalculatorA implements ISimpleCalculator&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;function &lt;/span&gt;CalculatorA()&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;      /* INTERFACE Examples.ISimpleCalculator */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;function &lt;/span&gt;Add(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;     &lt;span class="kwrd"&gt;return&lt;/span&gt; a + b;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;function &lt;/span&gt;Subtract(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;&lt;span class="kwrd"&gt;        return&lt;/span&gt; a - b;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;      /* Extend */&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;function &lt;/span&gt;Multiply(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;     &lt;span class="kwrd"&gt;return&lt;/span&gt; a * b;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;package &lt;/span&gt;Examples&lt;br /&gt;&lt;span class="kwrd"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CalculatorB implements ISimpleCalculator&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;     public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;function &lt;/span&gt;CalculatorB()&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;      /* INTERFACE Examples.ISimpleCalculator */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;function &lt;/span&gt;Add(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;&lt;span class="kwrd"&gt;          return&lt;/span&gt; Math.abs(a + b);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;function &lt;/span&gt;Subtract(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;&lt;span class="kwrd"&gt;          return&lt;/span&gt; Math.abs(a - b);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;      /* Extend */&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;      public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;function &lt;/span&gt;Divide(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;&lt;span class="kwrd"&gt;         if&lt;/span&gt; (b == 0)&lt;br /&gt;&lt;span class="kwrd"&gt;           return&lt;/span&gt; 0;&lt;br /&gt;&lt;span class="kwrd"&gt;      else&lt;/span&gt;&lt;br /&gt;          &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt;(Math.Abs(a / b));&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Each class also has its own method which didn’t declare in the interface. We want to use all the methods if possible so we create a new view.&lt;/p&gt;&lt;p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;package &lt;/span&gt;Examples&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;   public&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;view &lt;/span&gt;VCalculator &lt;span style="color: rgb(51, 51, 255);"&gt;bases on&lt;/span&gt; ISimpleCalculator&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       function &lt;/span&gt;Divide(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;default&lt;/span&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; 0;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       function &lt;/span&gt;Multiple(a:&lt;span class="kwrd"&gt;int&lt;/span&gt;, b:&lt;span class="kwrd"&gt;int&lt;/span&gt;):&lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;default&lt;/span&gt; &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Error(&lt;span class="str"&gt;"not support"&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The VCalculator view has declarations basing on ISimpleCalculator. It also add to more methods with default behavior. The first method will return 0 at default when the second will throws an exception. Then we may use it like this:&lt;/p&gt;&lt;p&gt;&lt;span id="ctl00_ContentPlaceHolder1_output"&gt;&lt;pre class="csharpcode"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;var &lt;/span&gt;viewA:VCalculator = &lt;span class="kwrd"&gt;new&lt;/span&gt; CalculatorA() &lt;span class="kwrd"&gt;as&lt;/span&gt; VCalculator;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (viewA != &lt;span class="kwrd"&gt;null&lt;/span&gt;) &lt;span class="rem"&gt;//convert sucessfully&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   var &lt;/span&gt;c:&lt;span class="kwrd"&gt;int&lt;/span&gt; = viewA.Add(2, 3);&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   var &lt;/span&gt;d:&lt;span class="kwrd"&gt;int&lt;/span&gt; = viewA.Multiple(2, 3);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;var &lt;/span&gt;viewB:VCalculator = &lt;span class="kwrd"&gt;new&lt;/span&gt; CalculatorB() &lt;span class="kwrd"&gt;as&lt;/span&gt; VCalculator;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (viewB != &lt;span class="kwrd"&gt;null&lt;/span&gt;) &lt;span class="rem"&gt;//convert sucessfully&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   var &lt;/span&gt;c:&lt;span class="kwrd"&gt;int&lt;/span&gt; = viewB.Add(2, 3);&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   var &lt;/span&gt;d:&lt;span class="kwrd"&gt;int&lt;/span&gt; = viewB.Divide(2, 3);&lt;br /&gt;}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The VCalculator can be converted from either CalculatorA or CalculatorB instances. After the conversion, the view can be used easily with some notices to methods which have default behavior.It’ could be more interesting if we get CalculatorA and Calculator B from external modules and use it easily with internal VCalculator.&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Some more features&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;Here are some more features that could be added to new View.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-          Checking a member is implemented or not. Example: we can use view.isImplemented(“memberName”).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-          Force a method to execute standard behavior. Example: view.forceStandard(“memberName”).&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;How could the new view concept help us&lt;br /&gt;&lt;/h2&gt;&lt;p&gt;First, the new View can provide new good solutions to many situations such as above ones. Now we have a method that could be safer, easier and have better performance to access an object with unknown class type. That would help plugin programming easier. If it’s supported, the new view would change the way we code a bit. Instead of using interface or dynamic type, we can use view as a better solution in some situations.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Everyone please give your thought about new ideas: Do you think it’ll be useful or not? Other situations you would love to use it? Do you want to extend it more?&lt;br /&gt;&lt;/p&gt;&lt;h1&gt;A little wish&lt;br /&gt;&lt;/h1&gt;&lt;p style="text-align: left;"&gt;After reading to here, I wish that you would think that my idea is somewhat that’s interesting and worth to have a look. As I said, C# and ActionScript is my main development languages so it’s wonderful if these languages support it in the next versions. Other languages would be great, too.&lt;/p&gt;&lt;p style="text-align: left;"&gt;BS. I added a poll so please take it if you come to here.&lt;br /&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;img style="visibility: hidden; width: 0px; height: 0px;" src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEyNDQ1MzM3NTM*NzcmcHQ9MTI*NDUzNDA2MTMyNyZwPTE2MTYwMSZkPXd3dy5xdWliYmxvLmNvbSZnPTEmdD*mbz*4OTBhMDk3YTg3ZmY*YmRhYWQ1NjMyZDcwNzIzZGJiYiZvZj*w.gif" border="0" height="0" width="0" /&gt;&lt;/p&gt;&lt;div align="center"&gt; &lt;object wmode="transparent" data="http://apps.quibblo.com/static/flash/qwidget/qwidget.swf?s=&amp;amp;theme=quibblo&amp;amp;quiz=9_fn-ea" allownetworking="all" allowscriptaccess="never" type="application/x-shockwave-flash" height="400" width="300"&gt;&lt;br /&gt;&lt;param name="movie" value="http://apps.quibblo.com/static/flash/qwidget/qwidget.swf?s=&amp;amp;theme=quibblo&amp;amp;quiz=9_fn-ea"&gt;&lt;br /&gt;&lt;param name="allowscriptaccess" value="never"&gt;&lt;br /&gt;&lt;param name="allownetworking" value="all"&gt;&lt;br /&gt;&lt;param name="wmode" value="transparent"&gt;&lt;br /&gt;&lt;param name="bgcolor" value="ffffff"&gt;&lt;br /&gt;&lt;/object&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt; &lt;a href="http://www.quibblo.com/"&gt;Quizzes&lt;/a&gt; by &lt;a href="http://www.quibblo.com/quiz/9_fn-ea/What-do-you-think-about-my-idea"&gt;Quibblo.com&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2803760956637347555-7222561430882044191?l=dakurai.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dakurai.blogspot.com/feeds/7222561430882044191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dakurai.blogspot.com/2009/06/new-wild-idea-in-oop.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2803760956637347555/posts/default/7222561430882044191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2803760956637347555/posts/default/7222561430882044191'/><link rel='alternate' type='text/html' href='http://dakurai.blogspot.com/2009/06/new-wild-idea-in-oop.html' title='New wild idea in OOP'/><author><name>Vo Hong Vinh</name><uri>http://www.blogger.com/profile/08085515550482870323</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry></feed>
