<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>model-view-controller &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/model-view-controller/</link>
	<description>Feed of posts on WordPress.com tagged "model-view-controller"</description>
	<pubDate>Tue, 21 May 2013 08:53:15 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Mari belajar CodeIgnitier (Pengantar)]]></title>
<link>http://justmeadiyat.wordpress.com/2012/02/02/mari-belajar-codeignitier-pengantar/</link>
<pubDate>Thu, 02 Feb 2012 06:00:12 +0000</pubDate>
<dc:creator>justmeadiyat</dc:creator>
<guid>http://justmeadiyat.wordpress.com/2012/02/02/mari-belajar-codeignitier-pengantar/</guid>
<description><![CDATA[Sehubungan Proyek Akhir menggunakan Framework PHP Code Ignitier, yang sebelumnya belum pernah di aja]]></description>
<content:encoded><![CDATA[Sehubungan Proyek Akhir menggunakan Framework PHP Code Ignitier, yang sebelumnya belum pernah di aja]]></content:encoded>
</item>
<item>
<title><![CDATA[Spring MVC Request flow]]></title>
<link>http://my100interview.wordpress.com/2012/02/01/spring-mvc-request-flow/</link>
<pubDate>Wed, 01 Feb 2012 14:33:01 +0000</pubDate>
<dc:creator>Amit Nagar</dc:creator>
<guid>http://my100interview.wordpress.com/2012/02/01/spring-mvc-request-flow/</guid>
<description><![CDATA[Spring MVC helps in building flexible and loosely coupled web applications. The Model-view-controlle]]></description>
<content:encoded><![CDATA[<p>Spring MVC helps in building flexible and loosely coupled web applications. The Model-view-controller design pattern helps in seperating the business logic, presentation logic and navigation logic. Models are responsible for encapsulating the application data. The Views render response to the user with the help of the model object . Controllers are responsible for receiving the request from the user and calling the back-end services.</p>
<p>The figure below shows the flow of request in the Spring MVC Framework.</p>
<p><img src="http://www.vaannila.com/images/spring/spring-mvc-pic-9.gif" alt="" /></p>
<p>When a request is sent to the Spring MVC Framework the following sequence of events happen.</p>
<ul>
<li>The <em>DispatcherServlet</em> first receives the request.</li>
<li>The <em>DispatcherServlet</em> consults the <em>HandlerMapping</em> and invokes the <em>Controller</em> associated with the request.</li>
<li>The <em>Controller</em> process the request by calling the appropriate service methods and returns a<em>ModeAndView</em> object to the <em>DispatcherServlet</em>. The <em>ModeAndView</em> object contains the model data and the view name.</li>
<li>The <em>DispatcherServlet</em> sends the view name to a <em>ViewResolver</em> to find the actual <em>View</em> to invoke.</li>
<li>Now the <em>DispatcherServlet</em> will pass the model object to the <em>View</em> to render the result.</li>
<li>The <em>View</em> with the help of the model data will render the result back to the user.</li>
</ul>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Spring MVC Request flow]]></title>
<link>http://interviewcook.wordpress.com/2012/02/01/spring-mvc-request-flow/</link>
<pubDate>Wed, 01 Feb 2012 14:33:01 +0000</pubDate>
<dc:creator>Amit Nagar</dc:creator>
<guid>http://interviewcook.wordpress.com/2012/02/01/spring-mvc-request-flow/</guid>
<description><![CDATA[Spring MVC helps in building flexible and loosely coupled web applications. The Model-view-controlle]]></description>
<content:encoded><![CDATA[<p>Spring MVC helps in building flexible and loosely coupled web applications. The Model-view-controller design pattern helps in seperating the business logic, presentation logic and navigation logic. Models are responsible for encapsulating the application data. The Views render response to the user with the help of the model object . Controllers are responsible for receiving the request from the user and calling the back-end services.</p>
<p>The figure below shows the flow of request in the Spring MVC Framework.</p>
<p><img src="http://www.vaannila.com/images/spring/spring-mvc-pic-9.gif" alt="" /></p>
<p>When a request is sent to the Spring MVC Framework the following sequence of events happen.</p>
<ul>
<li>The <em>DispatcherServlet</em> first receives the request.</li>
<li>The <em>DispatcherServlet</em> consults the <em>HandlerMapping</em> and invokes the <em>Controller</em> associated with the request.</li>
<li>The <em>Controller</em> process the request by calling the appropriate service methods and returns a<em>ModeAndView</em> object to the <em>DispatcherServlet</em>. The <em>ModeAndView</em> object contains the model data and the view name.</li>
<li>The <em>DispatcherServlet</em> sends the view name to a <em>ViewResolver</em> to find the actual <em>View</em> to invoke.</li>
<li>Now the <em>DispatcherServlet</em> will pass the model object to the <em>View</em> to render the result.</li>
<li>The <em>View</em> with the help of the model data will render the result back to the user.</li>
</ul>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Smarterphone end-to-end software solution for &quot;the next billion&quot; Nokia users]]></title>
<link>http://lazure2.wordpress.com/2012/01/09/smarterphone-end-to-end-software-solution-for-the-next-billion-nokia-users/</link>
<pubDate>Mon, 09 Jan 2012 17:58:49 +0000</pubDate>
<dc:creator>Nacsa Sándor</dc:creator>
<guid>http://lazure2.wordpress.com/2012/01/09/smarterphone-end-to-end-software-solution-for-the-next-billion-nokia-users/</guid>
<description><![CDATA[In Smart Devices, Nokia will build a winning ecosystem together with Microsoft using their global re]]></description>
<content:encoded><![CDATA[<blockquote><p>In <strong>Smart Devices</strong>, Nokia will <strong>build a winning ecosystem together with Microsoft</strong> using their global reach, iconic products and location services.</p></blockquote>
<blockquote><p>In <strong>Mobile Phones</strong>, Nokia will <strong>realign and increase its investments to connect </strong><a href="http://conversations.nokia.com/2011/02/11/mobile-phones-the-next-billion/"><strong>the next billion</strong></a><strong> people to the Internet</strong>, bringing great devices and rich services to the global marketplace much quicker.</p>
<p>And beyond great mobile products, Nokia will <strong>continue to innovate and invest in future disruptions</strong> that will define the industry in years to come.</p></blockquote>
<blockquote><p><em>From: </em><a href="http://conversations.nokia.com/2011/04/27/nokia-announces-next-steps-in-transformation/"><em>Nokia announces next steps in transformation</em></a><em> [</em><a href="http://conversations.nokia.com/about-us-2/"><em>Conversations by Nokia</em></a><em>, April 27, 2011]</em></p></blockquote>
<p>Update from <a href="http://seekingalpha.com/article/510541-nokia-s-ceo-discusses-q1-2012-results-earnings-call-transcript">Nokia&#8217;s CEO Discusses Q1 2012 Results &#8211; Earnings Call Transcript</a> [Seeking Alpha, April 19, 20<strong>12</strong>]</p>
<blockquote><p>&#8230; In the area of Mobile Phones, we continue to renew our Series 40 portfolio. For example, we recognized the need for dual SIM and delivered 8 dual SIM devices over the past year. We delivered consumers more aspirational designs and experiences through 7 new Asha products. The Net Promoter Scores for some Asha devices are the highest we&#8217;ve had for Mobile Phones products.</p>
<p>We<strong> acquired Smarterphone, a Norwegian company that brings new user interface technology and expertise</strong> to Nokia. We&#8217;ve increased download rates from feature phones to more than 4 million a day by improving store access and payment schemes and adding new apps like Whatsapp, Foursquare and EA.</p>
<p>We released a new version of Nokia Life, which delivers education, health, agriculture and entertainment services via SMS. And we delivered a new proxy browser, and we&#8217;re now bringing the browser and web apps down to super low-end devices. However, as we highlighted last week, there are still areas where our future phone portfolio is at a competitive disadvantage. We plan to address some of these issues in Q2.</p>
<p>That being said, the <strong>structural shift from feature phones <span style="color:#ff0000;">towards low-priced smartphones</span></strong> is a challenge. Our increased investments in Mobile Phones R&#38;D are intended to address these challenges. &#8230;</p></blockquote>
<p>From <a href="http://seekingalpha.com/article/510541-nokia-s-ceo-discusses-q1-2012-results-earnings-call-transcript?part=qanda">Q&#38;A part</a> of that:</p>
<blockquote><p>&#8230; we&#8217;<strong>ve been taking some very deliberate steps to not only pick up the pace, but to make it easier to accelerate the pace around the development in Series 40</strong>. I mentioned as <strong>one example, the acquisition of Smarterphone in this space to give us more flexibility and speed as it relates to the user interface elements, for example, of that platform</strong>. So this is &#8212; it&#8217;s a good example of something where, from a code and engineering perspective, we&#8217;re paying off a bit of a debt and having to catch up and accelerate. But you&#8217;re seeing the progress being made. But still in the near term, it causes us some problems, which is what gives me some confidence that we can continue to catch up and address those challenges. It&#8217;s just that the competition is ahead of us in a couple of spots, and we&#8217;ve got to nail that. &#8230;</p></blockquote>
<p><strong>Update from the Nokia CEO</strong> regarding the Mobile phones business and the Smarterphone acquisition:</p>
<blockquote><p><span style="color:#808080;"><strong>PCMAG:</strong> Recently you guys acquired Smarterphone, the feature phone OS company, and there had previously been some talk of your feature phone OS Meltemi. What are you going to do with those projects?</span></p>
<p><strong>Elop:</strong> We haven&#8217;t provided details of a key element here [<em>i.e. on CES 2012</em>] of our overall strategy. Last February we announced three pillars to our strategy. And one of those pillars was about increasing the R&#38;D investment in the mobile phone space. You&#8217;ve talked there of the fact that QT would be the development platform for that initiative. Clearly there&#8217;s some new work going on, new investments, you&#8217;re seeing little bits and pieces of acquisitions and things happening. We haven&#8217;t been more specific than that, but clearly there&#8217;s an initiative underway there that relates to our mobile phones efforts to connect the next billion people to the Internet.</p>
<p><span style="color:#808080;"><strong>PCMAG:</strong> Could this be a platform to supersede S40?</span></p>
<p><strong>Elop:</strong> So again, we haven&#8217;t provided any details, but S40 is a platform that continues to see significant investment. It&#8217;s getting smarter and smarter with each successive device and release, so there&#8217;s still a lot of activity there.</p>
<p>[<em>From: <a href="http://www.pcmag.com/article2/0,2817,2398755,00.asp">Nokia CEO: MS Purchase Rumors Bogus</a> [PC Magazine, Jan 11, 2012]</em>]</p></blockquote>
<p><a href="http://www.ferd.no/lang/en/show.do?page=291;623&#38;articleid=2456">Ferd Capital sells <strong>Smarterphone AS</strong> to <strong>Nokia</strong></a> [Ferd Capital press release, <a href="www.ferd.no/download.do?id=503">Jan 5</a> [after Jan 6 only in this PDF], 2012]</p>
<blockquote><p><a href="http://lazure2.files.wordpress.com/2012/01/image19.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:left;padding-top:0;border:0;margin:0 19px 0 0;" title="image" src="http://lazure2.files.wordpress.com/2012/01/image_thumb20.png?w=295&#038;h=203" alt="image" width="295" height="203" align="left" border="0" /></a>Egil Kvaleberg is a world class software architect and founder.</p></blockquote>
<blockquote><p><strong>Ferd Capital has sold its portfolio company <strong>Smarterphone</strong> AS (Formerly Kvaleberg AS) to Nokia Corporation (OMX: NOK1V, NYSE:NOK, FWB: NOA3), the world’s leading producer of mobile phones. The transaction was <span style="color:#ff0000;">completed in November</span> 2011.</strong></p>
<p>Smarterphone is based in Oslo, Norway and delivers <strong>an operating system for the feature phone segment of mobile handsets</strong>. The software <strong>makes it possible to deliver a user experience similar to smart phones on affordable hardware, and allows unique flexibility for tailoring handset software to different markets</strong>. <strong>Ferd Capital</strong> invested in the company in 2007 and has <strong>invested a total of 6,5 MEUR</strong> in the company.</p>
<p>“Egil Kvaleberg is a world class software architect and founder. His internationally recruited and unique team situated in Oslo has created <strong>an operating system for lower end mobile phone that provides highly advanced functionality on very moderate hardware</strong>” says Annar Bohn, Investment manager in Ferd Capital. “Our belief in the team, technology and the long term market for feature phones remains firm, and <strong>we believe the company has now found a fantastic new home with Nokia</strong>”, he continues.</p>
<p>&#8220;Ferd Capital is an active Nordic investor in both the venture and buy-out segments of private equity and see continued strong opportunities within both segments&#8221; says Bjørn Erik Reinseth, Partner in Ferd Capital. &#8220;Large international players acquiring Norwegian technology companies is a strong recognition and a good foundation for future innovation and growth&#8221;, continues Reinseth.</p>
<p>In addition to Ferd Capital, <strong>The company was also financed by</strong> Innovation Norway, <strong>Haavard Nord (Trolltech founder)</strong> and Lars Øberg. Carnegie acted as advisor to the selling shareholders. [<a href="http://www.esato.com/news/article.php/id=2182"><em>Ferd owned 80%</em></a><em> of the shares</em>]</p></blockquote>
<p><a href="http://conversations.nokia.com/nokia-strategy-2011/">Nokia Strategy 2011</a> [<a href="http://conversations.nokia.com/about-us-2/">Conversations by Nokia</a>, March 10, 2011]</p>
<blockquote><p>Nokia Strategy 2011 consists of three pillars:</p>
<ul>
<li>Smartphones;</li>
<li>The next billion;</li>
<li>Future disruptions.</li>
</ul>
<p><strong>Smartphones</strong></p>
<p>Beginning 2011, Nokia will use Microsoft’s Windows Phone for its main smartphone operating system. The reason for this is that the smartphone battle is now a war of ecosystems rather than just devices. An ecosystem consists of devices, services, third-party providers, a strong app market and delighted customers. Microsoft, Nokia and its other partners will form a strong ecosystem to bring innovation and choice into the market. MeeGo now becomes a platform for future disruption of the market through innovative and different devices. Symbian will continue to be supported and developed as the full product portfolio takes shape.</p>
<p>Articles:</p>
<p><a href="http://conversations.nokia.com/2011/02/11/open-letter-from-ceo-stephen-elop-nokia-and-ceo-steve-ballmer-microsoft/">Open Letter from Stephen Elop and Steve Ballmer</a><br />
<a href="http://conversations.nokia.com/2011/02/11/welcome-to-the-third-ecosystem/">Welcome to the Third Ecosystem</a><br />
<a href="http://conversations.nokia.com/2011/02/11/nokia-strategy-and-financial-briefing-video/">Nokia Strategy and Financial Briefing </a><br />
<a href="http://conversations.nokia.com/2011/02/11/stephen-elop-and-steve-ballmer-answer-questions-from-nokia-conversations-readers/">Stephen Elop and Steve Ballmer answer questions from Nokia Conversations readers</a><br />
<a href="http://conversations.nokia.com/2011/03/02/the-future-is-glanceable/">The future is glanceable</a></p>
<p><strong>The next billion</strong></p>
<p>Around 3.2 billion people do not currently own a mobile phone. Nokia’s reach, extensive product portfolio and market presence worldwide make it the best-placed manufacturer to supply the next billion mobile phone users with great devices and rich services suited to local needs. In addition, we’ll be taking the Internet to the users of these phones in their next step. The Series 40 operating system, Ovi Life Tools and Java development are keystones here.</p>
<p>Articles:</p>
<p><a href="http://conversations.nokia.com/2011/02/11/mobile-phones-the-next-billion/">Mobile Phones: the next billion</a><br />
<a href="http://conversations.nokia.com/2011/02/28/mary-mcdowell-on-the-next-billion/">Mary McDowell on the next billion</a><br />
<a href="http://conversations.nokia.com/2011/03/08/listen-up-the-nokia-x1-00-is-here/">Launch: the Nokia X1-00</a></p>
<p><strong>Future disruptions</strong></p>
<p>Innovation in the field of mobile devices is far from over and Nokia is determined to play a key role in the future of this field. MeeGo will play a key part in this, and continued support for revolutionary research and development work across Nokia’s worldwide research labs, the Qt development framework and independent providers will help to fuel this further.</p>
<p>Articles:</p>
<p><a href="http://conversations.nokia.com/2011/02/23/rich-green-at-nokia-developer-day/">Rich Green at Nokia Developer Day</a><br />
<a href="http://conversations.nokia.com/2011/03/10/reasons-to-get-stuck-on-qt-a-bakers-dozen/">13 reasons to get stuck on Qt</a></p></blockquote>
<p><a href="http://www.nokia.com/NOKIA_COM_1/About_Nokia/Sidebars_new_concept/Nokia_in_brief/In_briefApr11.pdf">Nokia in brief</a> [Nokia, April 7, 2011]</p>
<blockquote><p>…<br />
<strong>Nokia as of April 1, 2011</strong></p>
<p><a href="http://lazure2.files.wordpress.com/2012/01/image20.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;margin:0;" title="image" src="http://lazure2.files.wordpress.com/2012/01/image_thumb21.png?w=640&#038;h=433" alt="image" width="640" height="433" border="0" /></a></p></blockquote>
<blockquote><p><strong>Smart Devices</strong>: our business unit which focuses on smartphones, and additionally on exploring nextgeneration opportunities in devices, platforms and user experiences to support our industry position and longer-term financial performance.</p>
<p><strong>Mobile Phones</strong>: our business unit focused on bringing a modern and affordable mobile experience to people around the world.</p>
<p><strong>NAVTEQ</strong>: a leading provider of comprehensive digital map information and related location-based content and services for mobile navigation devices, automotive navigation systems, Internet-based mapping<br />
applications, and government and business solutions.</p>
<p><strong>Nokia Siemens Networks</strong>: jointly owned by Nokia and Siemens, is one of the leading providers of telecommunications infrastructure hardware, software and professional services globally.</p></blockquote>
<h3>Detailed information about the Smarterphone now under Nokia:</h3>
<p><a href="http://www.visionmobile.com/blog/2010/02/2010-in-review-under-the-radar-trends-at-mobile-world-congress/">2010 in review: Under-the-radar trends at Mobile World Congress</a> [<strong>Feb</strong> 22, 20<strong>10</strong>]</p>
<blockquote><p>… Kvaleberg (a little-known Norwegian engineering company) has productised its <strong>10-years of feature phone integration</strong> know-how into <strong>Mimiria</strong>, a <strong>feature phone OS</strong> with a <strong>clean-room UI architecture</strong> that <strong>makes variant creation a swift job requiring only 2-3 engineers to customise</strong>. …</p></blockquote>
<p><a href="http://www.ferd.no/lang/en/show.do?page=12;22&#38;articleid=2318">Smarterphone launches Smarterphone OS 3.0 at Mobile World Congress</a> [<strong>Feb</strong> 16, 20<strong>11</strong>]</p>
<blockquote><p><strong>Ferd Capital&#8217;s portfolio company Smarterphone AS (previously Kvaleberg AS) today announced version 3.0 of Smarterphone OS, the smart operating system for inexpensive mobile phones. </strong></p>
<p>The OS was from the beginning designed to run efficiently on limited resource hardware, yet still offering smart solutions, attractive and intuitive user interfaces. Version 3.0 brings this concept further, being <strong>optimized for phones in the $25 to $75 price segment</strong>.</p>
<p>&#8220;Globally, there are 4 billion mobile phone users. Despite all the attention given to high end smartphones, the majority of the 4 billion can not afford such a device,&#8221; says Egil Kvaleberg, CEO of Smarterphone. &#8220;With Smarterphone OS, inexpensive phones can be smart, too. Their users are just as keen to have easy and natural access to Facebook, Twitter and YouTube as users of high end phones.&#8221;</p>
<p>To <strong>demonstrate the flexibility and agility</strong> of their solution, Smarterphone will, during the Mobile World Congress 2011 in Barcelona, <strong>show &#8216;Radial,&#8217; which is a fresh approach at reshaping the dynamics of the mobile phone human interaction</strong>. Audun Foyen, director of products at Smarterphone, says: &#8220;<strong>Radial is an option</strong> we offer <strong>customers who may want to differentiate in a certain direction</strong>. We remain equally committed to more conventional touch and keypad solutions.&#8221;</p>
<p>Smarterphone felt the Mobile World Congress was the only natural choice for the premiere of Radial. &#8220;We are dedicated to MWC and see great value in attending the event every year,&#8221; says Michael Orr, SVP Business Development and Sales at Smarterphone AS.</p>
<p>More details on Radial: <a href="http://smarterphone.com/documents/Radialconceptuserinterface.pdf">http://smarterphone.com/documents/Radialconceptuserinterface.pdf</a></p>
<p><strong>About Smarterphone<br />
</strong>Smarterphone provides a complete and licensable software solution for mass market smart phones, Smarterphone OS, pre-integrating all software components and applications, enables manufacturers to rapidly create low-cost handsets with features and functionality similar to that found in expensive high-end smartphones. The solution is turnkey, whereby Smarterphone takes the software through all phases all the way up to carrier acceptance.</p></blockquote>
<p><a href="http://www.youtube.com/watch?v=R9227tzKrxI">Smarterphone &#8220;Radial&#8221; user interface demo</a> [<a href="http://www.youtube.com/user/SmarterphoneAS">SmarterphoneAS</a>, Feb 16, 2011]</p>
<div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:bd9c5d98-9418-47f8-b557-d8701749653d" class="wlWriterEditableSmartContent" style="width:448px;display:block;float:none;margin-left:auto;margin-right:auto;padding:0;">
<div><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/R9227tzKrxI?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></div>
<div style="width:448px;clear:both;font-size:.8em;">Shows demo of the new &#8220;Radial&#8221; concept user interface from Smarterphone. The video was shot at MWC 2011</div>
</div>
<p><a href="http://www.smarterphone.com/products.php">Products</a> [Dec 12, 2010]</p>
<blockquote><p><strong>Smarterphone 3.0</strong> is a software applications suite for mobile handsets that provides all of the layers from the hardware up to the end-user applications and what they need to interact with each other. This unique way of linking the hardware abstraction layer to the applications ensuring that we provide our handset users with a satisfying and high-quality experience. Our engineers have designed Smarterphone with operators in mind; we are fully adhere to the major operators&#8217; requirements. Our team of engineers have wide-ranging experience in the cellular UI industry and are always available to provide support for operators. <img src="http://www.smarterphone.com/images/products.png" alt="" /> Our developers have gone above and beyond working on Smarterphone to seamlessly integrate the end-user applications with each other and with the underlying hardware. We <strong>developed a scripting language</strong> that <strong>allows our engineers to quickly and easily adapt our software with any hardware platform</strong>. The settings are tailored to be compatible with any hardware platform. And our <strong>task-switcher makes it easy for users to multi-task with several applications at once time</strong>.</p>
<p>Some of Smarterphone&#8217;s major features are listed below:</p>
<ul>
<li>social media</li>
<li>sophisticated text entry (character recognition, predictive)</li>
<li>advanced web browser</li>
<li>advanced address book, integrating all connected services</li>
<li>theme switching</li>
<li>image viewer with thumbnail scrolling</li>
<li>media player for audio and video</li>
<li>messaging: email, MMS and SMS</li>
<li>JavaME applications engine</li>
<li>touch-screen (resistive or multi-touch capacitive)</li>
<li>wifi</li>
<li>Bluetooth</li>
<li>calendar and to-do</li>
<li>world wide weather forecasts</li>
<li>currency converter with auto updates</li>
</ul>
<p>Smarterphone has developed a sotfware solution that is pre-integrated, finished, and ready to roll, yet also offers unique possibilities for customization and differentiation. This combination, previously thought impossible, we have achieved by our unique software architecture that integrates and includes all applications in one seamless design. These possibilites have been made possible by an architechture that totally separates the software components that manage all aspects of the user experience from the components that actually implemnents the functionality. This is how we can offer a software package that we can very quickly tailor to any customer&#8217;s requirements, with confidence that the risk and cost will be low. All Smarterphone applications are integrated under the same regime, so that end-users with a common look and feel to every application simlpy is automatically ensured. To see a complete list of features, <a href="http://www.smarterphone.com/documents/smarterphone_features.pdf">click here</a>.</p>
<p>Smarterphone includes a full suite of applications for mobile phones built using the Smarterphone framework components. <strong>All the applications are designed</strong> according <strong>to the model-view-controller (MVC) design pattern</strong>. This means that <strong>application logic and application data are kept completely separate</strong> from <strong>the user interface itself</strong>. It is, <strong>therefore, a very simple operation to make deep changes in the user interface</strong>, even in its structure and flow.<br />
<img src="http://www.smarterphone.com/images/architecture.png" alt="" /></p>
<p><strong>Smarterphone</strong>&#8216;s, components are already fully integrated. This allows you to bring you products quickly to the market place, since software integration has traditionally been the major bottleneck.</p>
<p><strong>Smarterphone</strong> is a solution for a complete <em>feature phone</em>user interface in accordance to the most demanding operator requirements.</p>
<p><strong>Smarterphone</strong>is highly competitive on total cost.</p>
<p><strong>Smarterphone</strong>offers very rapid and scalable concepts for adapting to different UI designs and requirements, including new applications.</p>
<p><strong>Smarterphone</strong>is made for modern, highly visual UI designs.</p>
<p><strong>Smarterphone</strong>is based on an inherently reliable software architecture.</p>
<p><strong>Smarterphone</strong> is supported by a team with a wide base of experience in the cellular UI industry.</p></blockquote>
<p>More information:</p>
<ul>
<ul>
<li><a href="http://www.smarterphone.com/Products_Communication.php">Communication</a></li>
<li><a href="http://www.smarterphone.com/Products_Multimedia.php">Multimedia</a></li>
<li><a href="http://www.smarterphone.com/Products_Tools.php">Tools</a></li>
<li><a href="http://www.smarterphone.com/Products_Games.php">Games</a></li>
<li><a href="http://www.smarterphone.com/Products_Contacts.php">Contacts</a></li>
<li><a href="http://www.smarterphone.com/Products_Calendar.php">Calendar</a></li>
<li><a href="http://www.smarterphone.com/Products_Settings.php">Settings</a></li>
</ul>
</ul>
<p><a href="http://en.wikipedia.org/wiki/Smarterphone">Smarterphone</a> [wikipedia entry, excerpted on <strong>Jan</strong> 9, 20<strong>12</strong>]</p>
<blockquote><p>…<br />
The company&#8217;s main product is <strong>Smarterphone OS</strong>, which is a <a href="http://en.wikipedia.org/wiki/Platform-independent">platform-independent</a> full mobile phone operating system and applications suite for the <a href="http://en.wikipedia.org/wiki/Feature_phone">feature phone</a> segment. Smarterphone OS, then called <strong>Mimiria</strong>, was first unveiled at the <a href="http://en.wikipedia.org/wiki/Mobile_World_Congress">Mobile World Congress</a> show in February 2008, and has been used for such handsets as the <a href="http://en.wikipedia.org/wiki/Kyocera_C4700">Kyocera C4700</a>, <a href="http://en.wikipedia.org/wiki/Vibo_T588">Vibo T588</a>, and the <em>Madrid</em> <a href="http://en.wikipedia.org/wiki/LiMo_Foundation">LiMo</a> device. The Smarterphone architecture is <em>clean-room</em>, with a very strict <a href="http://en.wikipedia.org/wiki/Model-view-controller">model-view-controller</a> design that enables variations to be implemented with little effort. <sup><a href="http://en.wikipedia.org/wiki/#cite_note-7">[8]</a></sup> The <strong>user interface</strong> of Smarterphone OS is <strong>programmed in a scripting language</strong>, which is <strong>a variant of </strong><a href="http://en.wikipedia.org/wiki/Scheme_(programming_language)"><strong>Scheme</strong></a><strong> with </strong><a href="http://en.wikipedia.org/wiki/Object-oriented"><strong>object-oriented</strong></a><strong> extensions</strong>.</p>
<p>Smarterphone OS includes a user interface (<a href="http://en.wikipedia.org/wiki/User_interface">MMI</a>) <a href="http://en.wikipedia.org/wiki/Software_stack">software stack</a>, implementing a full user interface and middleware for <a href="http://en.wikipedia.org/wiki/2G">2G</a> and <a href="http://en.wikipedia.org/wiki/3G">3G</a> feature phones. It also integrates a range of third-party modules such as <a href="http://en.wikipedia.org/wiki/Java_ME">Java ME</a> JVM from <a href="http://en.wikipedia.org/wiki/Oracle_Corporation">Oracle Corporation</a>, <a href="http://en.wikipedia.org/wiki/Mobile_browser">mobile browser</a> from <a href="http://en.wikipedia.org/wiki/Obigo">Obigo</a>, <a href="http://en.wikipedia.org/wiki/Multimedia_Messaging_Service">MMS</a> and <a href="http://en.wikipedia.org/wiki/SMS">SMS</a> stack from Mobile Messaging Factory, predictive text input from <a href="http://en.wikipedia.org/wiki/Nuance_Communications">Nuance</a> and <a href="http://en.wikipedia.org/wiki/TouchPal">Cootek</a>, and handwriting recognition from Sinovoice.<br />
…</p></blockquote>
<p><a href="http://www.smarterphone.com/blog/?p=408">New Smarterphone OS release</a> [<strong>Oct</strong> 12, 20<strong>11</strong>]</p>
<blockquote><p>We are proud to annonce version 3.2 of Smarterphone OS. In this release we are featuring</p>
<p>- MultiSIM. It makes possible to use more than one SIM card.<br />
- BiDi. This feature adds support for <a href="http://www.smarterphone.com/blog/?p=356">bidirectional</a>writting. Necessary in languages like Arabic or Hebrew.</p>
<p>The software has also turned even more social, with many improvements to Facebook integration like:</p>
<p>- Video upload support.<br />
- Better support for comments and status.<br />
- Use pictures of friends in the address book.<br />
- Posting of pictures.<br />
- Chat.</p>
<p>We have not forgotten about Twitter and we made it easier to use.<br />
Support for uploading videos to Youtube has been added.</p>
<p><strong>Usability improvements</strong></p>
<p>- Geonames integration in Worldclock and Weather.<br />
- Better datetime picker.<br />
- Conversational Messaging.<br />
- Cut’n&#8217;Paste.</p>
<p><strong>UI improvements</strong></p>
<p>- New screen transition effects.<br />
- Configurable Widget bar (on left, or right, top or bottom).<br />
- Idle screen desktop shortcuts.<br />
- Scrollable wide desktop with background parallax effect.</p>
<p>There are many changes users won’t directly see, but they will feel them.<br />
I am of course speaking about performance. The software is noticibly faster and has a smaller memory footprint.</p>
<p>- Jorge</p></blockquote>
<p><a href="http://www.youtube.com/watch?v=0Pyl6lkztEk">Mimiria GW4 presentation</a> [<a href="http://www.youtube.com/user/kvaleberg">kvaleberg</a>, <strong>June</strong> 30, 20<strong>08</strong>]</p>
<div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:0442f144-d03c-42c3-98ca-cc256b2b9839" class="wlWriterEditableSmartContent" style="width:448px;display:block;float:none;margin-left:auto;margin-right:auto;padding:0;">
<div><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/0Pyl6lkztEk?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></div>
<div style="width:448px;clear:both;font-size:.8em;">Presentation of the Mimiria software solution from Kvaleberg for the Wistron GW4 cellphone</div>
</div>
<p><a href="http://www.smarterphone.com/news.php">Kvaleberg AS delivers complete software solution to Taiwan handset manufacturer</a> [from SmarterPhone/Kvaleberg press releases]</p>
<blockquote><p>Oslo, 18 July 2008) Kvaleberg AS has delivered the Mimiria Software Suite to Taiwan manufacturer Wistron NeWeb&#8217;s (WNC) GW4 handset. The delivery represents a significant milestone on Kvaleberg&#8217;s development effort, and demonstrates the unique advantages Mimiria provides for handset manufacturers.</p>
<p>The handset will be available commercially in Wistron&#8217;s key markets, and simultaneously <strong>provides Kvaleberg with a reference handset model</strong>. Porting the Mimiria software suite was completed in record time, and takes advantage of all the functionality available on the handset. <strong>Normally it takes 9 &#8211; 18 months to develop fully functional software for a new handset hardware design. By virtue of Mimiria, the process took under 3 months for the GW4</strong>.</p>
<p><em>We are very pleased with the cooperation with Wistron, and are proud of the excellent performance and intuitive user interface we have created for Wistron&#8217;s handset</em>, says Egil Kvaleberg, Managing Director of <strong>Kvaleberg</strong>AS.</p>
<p><em>Kvaleberg as our partner has good experience with software suites in the mobile industry and Kvaleberg&#8217;s Mimiria Software Suite provides highly flexible solutions that allow us to cost effectively pursue multiple markets</em>, said Wilson Zhang, Senior Director of <strong>Wistron</strong>NeWeb Corp.</p>
<p>The GW4 is a feature rich hardware platform which enables demonstration of the central capabilities of the Mimiria Software Suite. In comparison with traditional feature phones, the model distinguishes itself by having a touch screen, full QWERTY keypad, and WLAN capability.</p>
<p>Mimiria is a complete, turnkey, pre-integrated software suite in which all components of mobile phone software are included. Customers get access to a package that can run on any mobile phone hardware platform and operating system with a minimum of integration work. The solution is designed so that the user interface can easily be adapted to any operator or manufacturer requirements.</p>
<p>Kvaleberg has also added operator specific user interfaces to the GW4. The <strong>adaption took three weeks from start to finish</strong>. It proves that Wistron can quickly provide the GW4 to demanding mobile phone operators in Europe or the United States.</p>
<p><strong>Kvaleberg mainly provides Mimiria to mobile phone manufacturers in Asia who want to launch their models in North America and Europe</strong>. Kvaleberg AS has sales offices in China, San Diego, Korea and Taiwan. The main office is located in Oslo, Norway.</p></blockquote>
<p><a href="http://www.ferd.no/lang/en/show.do?page=291;623&#38;articleid=1556">Kvaleberg receives EUR 2 million in funding from Ferd Venture</a> [<strong>June</strong> 6, 20<strong>07</strong>]</p>
<blockquote><p><strong>Ferd Venture invests EUR 2 million in Kvaleberg AS, a software company headquartered in Oslo, Norway. The company has developed a new and fully integrated software application suite for mid- and low tier mobile phones (feature phones). The purpose of the funding round is to accelerate international expansion. </strong></p>
<p>Kvaleberg offers mobile phone manufacturers <strong>an integrated software suite containing all applications needed</strong> in addition to those supplied by the chipset manufacturers. This includes <strong>all end user applications one would expect</strong> from a mobile phone today. <strong>Kvaleberg’s offering makes it possible to reduce development cycles by 50%</strong> while ensuring compliance with the most stringent requirements from mobile operators.</p>
<p>- We strongly believe in the demand for Kvaleberg’s software solution. It targets the larger part of the mobile phone market and will be important to phone manufacturers in both mature and emerging markets, says Bjørn Erik Reinseth – responsible partner at Ferd Venture.</p>
<p>Kvaleberg has worked with leading international players in the business, including OpenWave, NEC and Broadcom, and is known as one of the best development teams in mobile software and software integration. The company’s main competitors are the internal development programs within the phone manufacturers, but the company believes there will be a gradual move towards standardised software solutions.</p>
<p>The funds will be used to strengthen both the sales and service capabilities internationally. In addition to the HQ in Oslo and an office in the US, Kvaleberg will also establish representation in Asia.</p>
<p>- We are very pleased with attracting Ferd Venture as an investor in Kvaleberg and especially appreciate the added competence on business development, says Egil Kvaleberg, founder and CEO of the company. Lars Øberg will serve as Chairman of the Board.</p>
<p><strong>About Kvaleberg AS<br />
</strong>KvalebergASwas <strong>founded</strong> by CEO Egil Kvaleberg <strong>in 1993</strong>. Through cutting edge mobile software application competence and insight the company has become internationally acknowledged as solid suppliers of top quality products. <strong>Historically, the company has focused on professional services</strong>, but <strong>will now focus on it’s integrated software application suite</strong>aimed at mobile phone producers.</p>
<p>The company is headquartered in Oslo, has 13 employees and is owned by Ferd Venture and management.</p>
<p>Visit <a href="http://www.kvaleberg.no/">www.kvaleberg.no</a> for more information.</p></blockquote>
<p><a href="http://www.ferd.no/lang/en/show.do?page=12;22&#38;articleid=1569">World-class software</a> [<strong>July</strong> 3, 20<strong>07</strong>]</p>
<blockquote><p><strong>Turnkey software solutions for mobile telephone manufacturers represent a specialised but large and growing market. Kvaleberg AS offers world-class solutions.</strong></p>
<p>In order to understand how Kvaleberg AS works, we need to look at how international mobile telephone manufacturers operate. Here we see that the bigger well-known companies are committing a lot of resources to developing expensive “smart” handsets with advanced functions, while handsets in the budget and medium price classes have become more or less standardised in terms of features and functionality. Accordingly, well-known manufacturers (such as Motorola and Sony-Ericsson) are increasingly turning to independent specialists to develop and manufacture their handsets in the budget and medium price classes. This can be a very cost-effective solution with short development lead times, partly because the specialists produce more or less the same product for a number of customers. Handset models are then tailored for the particular customer, with some minor differences in appearance and user interface – and of course the customer’s well-known brand name.</p>
<p><strong>ODM<br />
</strong>“Original Design Manufacturer” or ODM is the industry term for these independent suppliers, most of which are based in the Far East. They are often large companies, but names such as <em>Lenovo, Arima,</em> and <em>Compal</em>, are relatively little known even though they account for a large and increasing portion of the one billion mobile handsets sold every year.</p>
<p><strong>Outsourcing on the increase<br />
</strong>“Many ODMs have decided to outsource the development of handset software, and this is where Kvaleberg AS comes into the picture as an attractive partner. Since its launch in 1993, the company has become a widely recognized advisor, offering one of the world’s leading development environments for mobile handset software and software integration. Kvaleberg has now capitalised on this position to develop a complete turnkey software suite offering all the usual applications that consumers now expect from their mobile handsets”, explains Bjørn Erik Reinseth.</p>
<p><strong>Advance software<br />
</strong>The software suite can be quickly and easily customised for different user interfaces, hardware solutions and functionality. It is often the case that up to 90% of the software can be reused when a new handset model is developed, and this reduces the normal development period of 12 to 18 months to between 6 and 9 months.</p>
<p>“ODMs operate in a market where competitiveness depends on the speed of innovation, making software a critical factor. Mobile network operators impose strict requirements, while at the same time inexpensive handsets make it all the more important to make best use of processing and storage capacity. This is the area in which Kvaleberghas developed world-class expertise and solutions”, addsBjørn Erik Reinseth.</p>
<p><strong>Software refinements and marketing<br />
Ferd Venture</strong> has <strong>invested NOK 15 million in Kvaleberg</strong>. The company <strong>intends to use the new financing for sales and marketing and for the last stages of refining the software suite that it plans to launch this autumn</strong>. The company currently has 16 employees, with its head office in Oslo and an office in California. Work is now under way on opening an office in Taiwan, which is a central location for the majority of the company’s customers. The investors in the company other than Ferd Venture are the founder Egil Kvaleberg and certain employees.</p>
<p>Bjørn Erik Reinseth was responsible for work on the Kvaleberg investment, with Annar Bøhn and Pål M. Rødseth making up the team.</p>
<p><img src="http://www.ferd.no/lang/en/image.do?orig_id=931&#38;w=300" alt="" align="baseline" border="0" hspace="0" /><img src="http://www.ferd.no/lang/en/image.do?orig_id=932&#38;w=300" alt="" align="baseline" border="0" hspace="0" /><img src="http://www.ferd.no/lang/en/image.do?orig_id=933&#38;w=300" alt="" align="baseline" border="0" hspace="0" /></p></blockquote>
<p><a href="http://www.smarterphone.com/news.php">Series B investment</a> [from SmarterPhone/Kvaleberg press releases]</p>
<blockquote><p>(Oslo, 25 <strong>Jan</strong>uary 20<strong>11</strong>) <strong>Smarterphone</strong> today announced the completion of a Series B investment of <strong>5 million USD</strong> by <strong>Ferd Capital</strong>, a privately-owned Norwegian industrial and financial group.</p>
<p>Smarterphone, formerly Kvaleberg AS, is the creator of the mobile handset software Smarterphone OS that enables mobile phone manufacturers to build and sell 3G smart phones at a low cost in high volume markets.</p>
<p>&#8220;We believe that <strong>Smarterphone could become the Wal-Mart of mobile handsets</strong>&#8220;, said Bjørn Erik Reinseth, Partner of Ferd Capital. &#8220;<strong>Apple iPhone and Android-based phones</strong> have paved the way for smart phones worldwide, however, they <strong>require sophisticated hardware and therefore become too expensive for most people in the world</strong>. <span style="color:#ff0000;"><strong>Smarterphone are able to build the advanced features of these high-end phones in low cost 3G handsets, thereby making every phone smart</strong></span>&#8220;.</p>
<p>One of the key focus areas of Smarterphone is the concept of the smart mobile phone as a seamless integration of all modern means of communication into one device, always available. &#8220;Taking a picture and immediately sharing it on your Facebook wall should be just as easy and natural as making a call or sending a text message,&#8221; said Egil Kvaleberg, Founder and CEO of Smarterphone. &#8220;With our solution, this kind of versatility is affordable for everyone.&#8221;</p></blockquote>
<p><a href="http://www.smarterphone.com/news.php">News</a> [selectively from SmarterPhone/Kvaleberg press releases]</p>
<blockquote><p><a name="sinovoice"></a></p>
<h4>Kvaleberg enters into sublicense agreement with SinoVoice</h4>
<p><a name="sinovoice"></a></p>
<p>(Oslo, 29 October 2009) Kvaleberg have today signed a licensing agreement with</p>
<p><a name="sinovoice"></a> <a href="http://www.sinovoice.com.cn/english/tiyan.html">SinoVoice</a> of Beijing, China. Handwriting recognition is considered to be an extremely important feature on handsets for the Chinese handset market, and this agreement allows Kvaleberg to offer the <a href="http://www.sinovoice.com.cn/english/product.html"><strong>InfoQuick™</strong></a><strong> Chinese handwriting recognition software</strong> to customers all over Asia <strong>as part of Mimiria</strong>.</p>
<hr />
<p><a name="cootek"></a></p>
<h4>Kvaleberg signs licensing agreement with CooTek</h4>
<p><a name="cootek"></a></p>
<p>(Oslo, 22 October 2009) Kvaleberg have today signed an agreement with</p>
<p><a name="cootek"></a> <a href="http://www.cootek.com/">CooTek</a> of Shanghai, China. CooTek TouchPal offers predictive text input for over 20 languages, and input speeds of up to 450 characters per minute. Kvaleberg AS are extremely pleased with both the performance and memory footprint of the prediction engine, and with the support from the CooTek team. The agreement allows Kvaleberg to offer the <strong>CooTek </strong><a href="http://www.cootek.com/intro.aspx"><strong>TouchPal</strong></a><strong> text entry and prediction product</strong> as a <strong>pre-integrated component of the Mimiria software solution</strong></p>
<hr />
<p><a name="nuance"></a><strong>Nuance signs license and bundling agreement with Kvaleberg</strong></p>
<p>(Oslo, 30 June 2009) Kvaleberg today signed an agreement with <a href="http://www.nuance.com/">Nuance</a> of Belgium, the leading provider of speech and imaging solutions, that allows Kvaleberg to offer the <a href="http://www.nuance.com/zi/text-entry.asp"><strong>eZiText™ and eZiType™</strong></a><strong> mobile phone keypad text entry and prediction engine</strong> as <strong>integral parts of the Mimiria software solution</strong>.</p>
<hr />
<p><a name="sun"></a></p>
<h4>Kvaleberg approved as Sun <em>Value Added Provider</em> for Java™ ME</h4>
<p><a name="sun"></a></p>
<p>(Oslo, 20 March 2009) Kvaleberg today was approved by <a href="http://www.sun.com/">Sun Microsystems</a> as a <strong><em>Value Added Provider </em></strong>for <strong>components in the Java Platform, Micro Edition</strong> like CLDC, MIDP, WMA and MMAPI. The agreement allows Kvaleberg to <strong>integrate and configure Java ME on devices together with the Mimiria platform, as <em>Wireless Performance Pack</em>s</strong>. Additionally, Kvaleberg takes full responsibility for the Java compliance process, including carrying out the TCK testing process. This agreement allows Kvaleberg to offer a full <em>one-stop-shop</em> for Mimiria, including the Java ME solution, further strengthening the value provided to the Mimiria customers.</p>
<hr />
<p><a name="obigo"></a></p>
<h4>Kvaleberg signs agreement with Obigo</h4>
<p><a name="obigo"></a></p>
<p>Kvaleberg have now signed a licensing agreement with South Korean</p>
<p><a name="obigo"></a> <a href="http://www.obigo.com/">Obigo</a>. The agreement allows Kvaleberg to offer <strong>the </strong><a href="http://www.obigo.com/?no=23"><strong>Obigo Q7 Browser</strong></a><strong> in combination with the Mimiria software solution</strong>. The Obigo Q7 Browser is a very capable browser for modern <em>Full Internet </em>content. The Obigo browser also supports WAP, and is compliant with demanding operator&#8217;s requirements. It is thus a perfect component for <strong>Mimiria</strong>, which is <strong>aimed at mass-market 3G phones</strong>.</p>
<p><a name="sun"></a></p>
<hr />
<p><a name="smarterphone"></a>Kvaleberg AS partners with SmarterPhone</p>
<p><a name="sun"></a></p>
<p><em><strong>Kvaleberg AS to integrate SmarterPhone into Mimiria</strong> </em>(Oslo, Norway 16 <strong>Feb</strong>ruary 20<strong>08</strong>)</p>
<p><a name="sun"></a></p>
<p>Kvaleberg AS announced today that they have signed a contract with SmarterPhone that will allow them to <strong>integrate SmarterPhone&#8217;s Unified Messaging Engine (UME) into Mimiria</strong>, Kvaleberg&#8217;s turnkey software suite for mobile phones. This partnership will allow Kvaleberg&#8217;s customers a wider choice, giving access to SmarterPhone&#8217;s capabilities for SMS, MMS, Email, and instant messaging in its flagship software, Mimiria.</p>
<p><a name="sun"></a></p>
<p><strong>About Kvaleberg AS</strong></p>
<p><a name="sun"></a></p>
<p>Kvaleberg AS, a software development company headquartered in Oslo, Norway, was founded in 1993 by Egil Kvaleberg and employs 24 developers. Mimiria is Kvaleberg&#8217;s flagship software, which is a turnkey suite of mobile phone software and applications offering a complete solution for handset manufacturers. Kvaleberg AS has sales offices in San Diego, California; Beijing, China; and Taiwan. For more information on Kvaleberg AS or Mimiria, contact Audun Føyen at +47 918 42 168 or send an email to audun@smarterphone.com. <strong>Kvaleberg&#8217;s Web site</strong> can be found at <a href="http://www.smarterphone.com/"><strong>www.smarterphone.com</strong></a>.</p>
<p><a name="sun"></a></p>
<p><strong>About SmarterPhone</strong></p>
<p><a name="sun"></a></p>
<p>SmarterPhone is a provider of innovative software solutions for mobile devices, specializing in embedded messaging software. Available in an SDK, its Unified Messaging Engine (UME) allows OEMs to deliver an exceptional messaging experience to the user, while reducing integration costs and speeding time-to-market. For more information about SmarterPhone, contact Zim Kalinowski at +44 789 99 135 63 or send an email to zim@smarterphone.com. SmarterPhone&#8217;s Web site can be found at <a href="http://ume.smarterphone.com/">ume.smarterphone.com</a>.</p>
<p><a name="sun"></a></p>
<hr />
<p><a name="beep"></a><strong>Kvaleberg signs license and distribution agreement with Beep Science</strong></p>
<p><a name="sun"></a></p>
<p>Kvaleberg AS has signed a license and distribution agreement with Beep Science AS for <strong>Beep Science OMA DRM 2.0</strong>. This enables Kvaleberg <strong>to pre-integrate Beep Science&#8217;s industry leading OMA DRM 2.0 technology into the Mimiria applications suite</strong>.</p>
<p><a name="sun"></a></p>
<p><strong>About Beep Science</strong></p>
<p><a name="sun"></a></p>
<p>Beep Science AS is a <strong>leading provider of mobile Digital Rights Management (DRM) software solutions</strong>, enabling exciting new digital content services around the world. Founded in 2000, the company has established itself as internationally recognized specialist within the field of Mobile DRM. Beep Science provides DRM clients to device manufacturers and platform vendors and DRM servers to mobile operators and service providers. Beep Science&#8217;s DRM products are based on Open Mobile Alliance (OMA) industry standards as well as supporting other DRM schemes in the market. The company&#8217;s customers include major ODMs and OEMs and mobile operators worldwide. For further information, please visit<a href="http://www.beepscience.com/">www.beepscience.com</a>.</p>
<hr />
<p><a name="openwave"></a><strong>Kvaleberg signs license and distribution agreement with Openwave Systems Inc</strong></p>
<p><a name="sun"></a></p>
<p>Kvaleberg AS has signed a master license and distribution agreement with Openwave Systems, Inc. for the <strong>Openwave® Mobile Browser</strong>, the <strong>Openwave V7 Framework</strong>, the <strong>Openwave SMS/EMS/MMS Client</strong> and <strong>Openwave AirTX Predictive Text</strong>. This enables Kvaleberg to make this world-leading Openwave portfolio of mobile handset solutions <strong>part of its complete, pre-integrated Mimiria application suite</strong>. The agreement allows Kvaleberg to offer its customers a complete one-stop shopping solution for mobile handset software.</p>
<p><a name="sun"></a></p>
<p><strong>About Openwave</strong></p>
<p><a name="sun"></a></p>
<p>Openwave Systems Inc. (Nasdaq: OPWV) is the leading independent provider of open software solutions for the communications and media industry. Openwave software solutions are designed to enable customers to accelerate ARPU by rapidly launching value-added communication, information and entertainment services across networks and devices, and comprise a broad range of solutions including content delivery, messaging, music, video, and location. Openwave is a global company headquartered in Redwood City, California. For more information please visit <a href="http://www.openwave.com/">www.openwave.com</a>.</p>
<p><a name="sun"></a></p></blockquote>
]]></content:encoded>
</item>
<item>
<title><![CDATA[MVC Architechture]]></title>
<link>http://shahrulbahrimustapha.wordpress.com/2011/12/30/mvc-architechture/</link>
<pubDate>Fri, 30 Dec 2011 12:12:27 +0000</pubDate>
<dc:creator>Shahrul Mustapha</dc:creator>
<guid>http://shahrulbahrimustapha.wordpress.com/2011/12/30/mvc-architechture/</guid>
<description><![CDATA[Model-View-Controller architecture is all about dividing application components into three different]]></description>
<content:encoded><![CDATA[<p>Model-View-Controller architecture is all about dividing application components into three different categories Model, View and the Controller.</p>
<p>Components of the MVC architecture has unique responsibility and each component is independent of the other component.</p>
<p>Changes in one component will have no or less impact on other component (in other words, &#8216;loose coupling&#8217;).</p>
<h3>MODEL</h3>
<p>Model is responsible for providing the data from the database and saving the data into the data store.</p>
<h3>VIEW</h3>
<p>View represents the user view of the application and is responsible for taking the input from the user, dispatching the request to the controller and then receiving response from the controller and displaying the result to the user.</p>
<h3>CONTROLLER</h3>
<p>Controller is responsible for receiving the request from client.</p>
<p>Once request is received from client it executes the appropriate business logic from the Model and then produce the output to the user using the View component</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[MVC design/structure for PHP]]></title>
<link>http://chandreshmaheshwari.wordpress.com/2011/12/21/mvc-designstructure-for-php/</link>
<pubDate>Wed, 21 Dec 2011 13:05:42 +0000</pubDate>
<dc:creator>chan's</dc:creator>
<guid>http://chandreshmaheshwari.wordpress.com/2011/12/21/mvc-designstructure-for-php/</guid>
<description><![CDATA[Hello, here is the brief description for MVC (Model-View-Controller). The MVC paradigm is a way of b]]></description>
<content:encoded><![CDATA[Hello, here is the brief description for MVC (Model-View-Controller). The MVC paradigm is a way of b]]></content:encoded>
</item>
<item>
<title><![CDATA[Web Model View Controller (MVC) Concept with PHP example]]></title>
<link>http://gugiaji.wordpress.com/2011/12/19/webmodel-view-controller-mvc-concept-with-php-example/</link>
<pubDate>Mon, 19 Dec 2011 05:17:04 +0000</pubDate>
<dc:creator>gugiaji</dc:creator>
<guid>http://gugiaji.wordpress.com/2011/12/19/webmodel-view-controller-mvc-concept-with-php-example/</guid>
<description><![CDATA[Small web application doesn&#8217;t require architecture design. It means server script, html, clien]]></description>
<content:encoded><![CDATA[<p>Small web application doesn&#8217;t require architecture design. It means server script, html, client script can be put on single file for one web page. On the other hand, large business and scope with much more user, change requirement occurs so many times requires good &#38; reliable web architecture design. It is just not simple any more to put everything on single file since the web may update and grow often.</p>
<p>When business requirement become more complex then related web application usually consume more programmers. </p>
<p>Those programmers can work per module i.e. manufacturing, finance, sales, shipping modules etc. One programmer / team work on manufacturing and other programmers / team work on other modules. It depends on software designer, sometimes work module could be mix.<br />
<!--more--><br />
Script files at particular module must be dedicated / locked to one programmer in time. Prevent others change that script. After it un-locked then others could change it. It may occur several times that one programmer have to wait others to finish their task before he/she can work.</p>
<p>Large scope and tight deadline web application can not have so many &#8216;serial&#8217; wait and work type. We have to use better approach to design web architecture. Often, this design can be difficult to manage and maintain.</p>
<p>One good approach to design web application is to use layered architecture. This approach similar with building design architecture. The construction plans include separate blueprints for the foundation, frame, roof, plumbing, electrical and other floors. Each component like floor can be viewed as &#8216;layers&#8217;. The layers should be independent of one anothers, as much as possible and have clear focus. Also layers should have the way to connect to each other.</p>
<p>One common approach for designing web application using layered architecture is called Model View Controller (MVC).</p>
<ul>
<li>Model is application business layer that represents the business entities such as customers, employee, products, sales etc</li>
<li>View is application user interface. It is layout or look and feel of the web application</li>
<li>Controller is user action. It manages events that processed in application. In practical, controller choose which method &#38; view to build a page.</li>
</ul>
<p>In simple term, MVC separate between business layer and user interface layer. Also with this layered design, all staff on team can work at the same time because they work independently to others.</p>
<p>A lot of life example on application layer around us. For example PayPal API payment gateway. Paypal provides a way to make a payment button that can be pluged into member website. Member just copy &#38; paste the button tag based on product &#38; price they specified into their html page. If users visit their website and click Buy Now button, users will redirected to paypal site and fill in credit card information. Finally a fund already appear on paypal member page without knowing what happen or code that run behind payment process.  </p>
<p>How can we build MVC that it&#8217;s layers independent to each other? Well, the best way is using concept of OOP programming.</p>
<p>Here&#8217;s a simple example of model layer that contains business entity, products, model.php :<br />
<code><br />
class modelproduct {<br />
function __construct() { }</p>
<p>function products() {<br />
  return array("Bike", "Car", "Accessories");<br />
}<br />
}<br />
</code><br />
View Layer. It is user interface design, off course this produces html tags. view.php :<br />
<code><br />
class viewproduct {<br />
	function __construct() {}</p>
<p>	function view($product) {<br />
		echo &#34;&#60;table&#62;&#34;<br />
		foreach ($product as $pr) {<br />
			echo &#34;&#60;tr&#62;&#60;td&#62;&#34;.$pr.&#34;&#60;/td&#62;&#60;/tr&#62;&#34;;<br />
		}<br />
		echo &#34;&#60;/table&#62;&#34;;<br />
	}<br />
}<br />
</code><br />
Controller. Like its name, it is to control (choose) which model and view layer class that suitable to related application or page, controller.php:<br />
<code><br />
include &#34;model.php&#34;;<br />
include &#34;view.php&#34;;<br />
class productcontroller {<br />
	private $p;<br />
	function __construct() {<br />
		$this-&#62;p = new modelproduct();<br />
	}<br />
	function loadproduct() {<br />
		$v = new viewproduct();<br />
		$v-&#62;view($this-&#62;p-&#62;products());<br />
	}<br />
}<br />
</code><br />
HTML Page:<br />
<code><br />
&#60;html&#62;<br />
&#60;body&#62;<br />
&#60;?php<br />
	include "controller.php";<br />
	$cp = new productcontroller();<br />
$cp-&#62;loadproduct();<br />
?&#62;<br />
&#60;/body&#62;<br />
&#60;/html&#62;<br />
</code></p>
<p>Lets try several scenario. First, easiest case, products need to be added. Only programmer that work on model layer need to be informed. We can modify modelproduct class only. View &#38; constructor are not affected.</p>
<p>Second, view to represent product need to be modified. Change only on viewproduct class. Model &#38; controller are independent from view.</p>
<p>Third, maybe for some reason constructor need to change/add type of product. So, constructor can choose another modelproduct class i.e modelproduct2 or other else. Model &#38; view them self remain the same. Off course, before constructor can choose modelproduct2, we already have the class that requested from business requirement or class diagram.</p>
<p>Class diagram is important to ensure we can write MVC layers together in the same time not waiting others finishing their tasks. Class diagram is tool to coordinate between programmers in team. Beside that, some meetings and planning might be needed.</p>
<p>In the end, MVC increases productivity for large scope and complex web application.</p>
<p>Cheers,<br />
Agung Gugiaji</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Sr. Flex/ActionScript Engineer (Consulting/Contract) - Midtown Manhattan, NYC]]></title>
<link>http://itmediajobsnyc.wordpress.com/?p=649</link>
<pubDate>Mon, 14 Nov 2011 19:42:17 +0000</pubDate>
<dc:creator>itmediajobsnyc</dc:creator>
<guid>http://itmediajobsnyc.wordpress.com/?p=649</guid>
<description><![CDATA[Sr. Flex/ActionScript Engineer LOCATION: Midtown Manhattan, NYC TERMS: Long-Term Open-Ended Contract]]></description>
<content:encoded><![CDATA[Sr. Flex/ActionScript Engineer LOCATION: Midtown Manhattan, NYC TERMS: Long-Term Open-Ended Contract]]></content:encoded>
</item>
<item>
<title><![CDATA[Javascript Model-View-Controller example]]></title>
<link>http://agilewarrior.wordpress.com/2011/10/26/javascript-model-view-controller-example/</link>
<pubDate>Wed, 26 Oct 2011 12:32:19 +0000</pubDate>
<dc:creator>JR</dc:creator>
<guid>http://agilewarrior.wordpress.com/2011/10/26/javascript-model-view-controller-example/</guid>
<description><![CDATA[When I first got into Javascript, it wasn&#8217;t obvious to me how best to use the language to do a]]></description>
<content:encoded><![CDATA[<p>When I first got into Javascript, it wasn&#8217;t obvious to me how best to use the language to do a simple model-view-controller. </p>
<p>I&#8217;ve heard of <a href="http://documentcloud.github.com/backbone/">backbone</a>, <a href="http://spinejs.com/">spine</a>, and some other javascript mvc frameworks, but I just wanted to start with something really simple. My friend Jonas came up with a good example showing how our thinking has evolved after building some stuff.</p>
<p><strong>Option 1: Prototype</strong></p>
<p>In the prototype method you define your functions using the javascript prototype construct and then make use of &#8216;this&#8217; and &#8216;self&#8217; to make sure you are calling your methods with the right javascript context.</p>
<p>This is how we first stared doing simple mvc.</p>
<p><strong>FormModel_literal.js</strong></p>
<pre class="brush: jscript; title: ; notranslate" title="">
var FormModel = function(){};

FormModel.prototype.getInputText = function(){
   return $('#inputtext').val();
};

FormModel.prototype.setInputText = function(value){
   $('#inputtext').val(value);
};
</pre>
<p><strong>FormController_prototype.js</strong></p>
<pre class="brush: jscript; title: ; notranslate" title="">
var FormController = function(pModel){

    this.model = pModel &#124;&#124; new FormModel();
    
    this.fill_clicked = function(){
        this.model.setInputText('Hello World');
    };

    this.clear_clicked = function(){
        this.model.setInputText('');
    }
};

FormController.prototype.init = function(){

    var self = this;

    $('#fillbutton').click(function(){ self.fill_clicked(); });
    $('#clearbutton').click(function(){ self.clear_clicked(); });
};

FormController.prototype.getModel = function(){
    return this.model;
};
</pre>
<p>It&#8217;s nice. It works. You don&#8217;t need to worry about state (it&#8217;s all in the model). But you do need to watch context (this, that, and self) and it&#8217;s easy to get wrong if you aren&#8217;t careful.</p>
<p><strong>Option 2: Literal method</strong></p>
<p>In the literal method, you use the javascript literal construct to keep most internal methods private, and then only expose those you want publicly consumed in the return statement.</p>
<p><strong>FormModel_literal.js</strong></p>
<pre class="brush: jscript; title: ; notranslate" title="">
var FormModel = function(){

    function getInputText(){
       return $('#inputtext').val();
    }

    function setInputText(value){
       $('#inputtext').val(value);
    }

    return {
        getInputText : getInputText,
        setInputText : setInputText
    }
};
</pre>
<p><strong>FormController_literal.js</strong></p>
<pre class="brush: jscript; title: ; notranslate" title="">
var FormController = function(pModel){

    var model = pModel &#124;&#124; new FormModel();

    function fill_clicked(){
        model.setInputText('Hello World');
    }

    function clear_clicked(){
        model.setInputText('');
    }

    function init(){

        $('#fillbutton').click(function(){ fill_clicked(); });
        $('#clearbutton').click(function(){ clear_clicked(); });
    }

    return {
        init: init,
        model : model
    };
};
</pre>
<p>I think it&#8217;s elegant and nice. And I didn&#8217;t even know you could use a return statement like that in Javascript.</p>
<p>The advantage of this method is you don&#8217;t have to worry so much about getting the context wrong (this, that and self) as it&#8217;s all in the same context. </p>
<p>And it&#8217;s just easier on the eyes for me as it more closely resembles the classical OO model I am used to in Java and C#.</p>
<p>You can hook these up in view a test page as follows:</p>
<p><img src="http://agilewarrior.files.wordpress.com/2011/10/javascript-mvc-example.png?w=288&#038;h=34" alt="" title="javascript-mvc-example" width="288" height="34" class="alignnone size-full wp-image-2324" /></p>
<pre class="brush: xml; title: ; notranslate" title="">
&#60;html&#62;

    &#60;head&#62;
        &#60;script type=&#34;text/javascript&#34; src=&#34;jquery-1.6.1.min.js&#34;&#62;&#60;/script&#62;

        &#60;!-- Using function returning an Object literal (my preference) --&#62;
        &#60;script type=&#34;text/javascript&#34; src=&#34;js/controllers/FormController_literal.js&#34;&#62;&#60;/script&#62;
        &#60;script type=&#34;text/javascript&#34; src=&#34;js/models/FormModel_literal.js&#34;&#62;&#60;/script&#62;

        &#60;!-- Using Prototype --&#62;
        &#60;!--&#60;script type=&#34;text/javascript&#34; src=&#34;js/controllers/FormController_prototype.js&#34; &#62;&#60;/script&#62;--&#62;
        &#60;!--&#60;script type=&#34;text/javascript&#34; src=&#34;js/models/FormModel_prototype.js&#34;&#62;&#60;/script&#62;--&#62;

        &#60;script type=&#34;text/javascript&#34;&#62;

            $(document).ready(function() {
                new FormController().init();
            });

        &#60;/script&#62;

    &#60;/head&#62;

    &#60;body&#62;
        &#60;input type=&#34;text&#34; id=&#34;inputtext&#34; name=&#34;inputtext&#34; value=&#34;&#34; /&#62;
        &#60;input type=&#34;button&#34; id=&#34;fillbutton&#34; value=&#34;Fill with Text&#34;/&#62;
        &#60;input type=&#34;button&#34; id=&#34;clearbutton&#34; value=&#34;Clear&#34;/&#62;
    &#60;/body&#62;

&#60;/html&#62;
</pre>
<p>So while both methods will work, we are currently leaning towards option 2 (the literal method).</p>
<p>It just seems cleaner, less stuff to worry about, and it looks good. Of course being relatively new to hard core javascript, and still looking for better ways, we reserve the right to change our minds tomorrow. </p>
<p>If you have any tips, better ideas, or feedback, we&#8217;d love to hear them.</p>
<p>Update:<br />
Nice write up along similar lines from <a href="http://olabini.com/blog/2011/10/javascript-in-the-small/">Ola Bini</a>.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[รู้จักกับ MVC]]></title>
<link>http://oogosite.wordpress.com/2011/10/09/%e0%b8%a3%e0%b8%b9%e0%b9%89%e0%b8%88%e0%b8%b1%e0%b8%81%e0%b8%81%e0%b8%b1%e0%b8%9a-mvc/</link>
<pubDate>Sun, 09 Oct 2011 03:54:19 +0000</pubDate>
<dc:creator>oogosite</dc:creator>
<guid>http://oogosite.wordpress.com/2011/10/09/%e0%b8%a3%e0%b8%b9%e0%b9%89%e0%b8%88%e0%b8%b1%e0%b8%81%e0%b8%81%e0%b8%b1%e0%b8%9a-mvc/</guid>
<description><![CDATA[มาทำความรู้จักกับ MVC (Model View Controller) MVC (Model View Controller) เป็นสถาปัตยกรรมซอฟแวร์ (so]]></description>
<content:encoded><![CDATA[<p><a href="http://oogosite.files.wordpress.com/2011/10/mvc.png"><img class="alignnone size-medium wp-image-209" title="mvc" src="http://oogosite.files.wordpress.com/2011/10/mvc.png?w=300&#038;h=240" alt="" width="300" height="240" /></a></p>
<h4><strong>มาทำความรู้จักกับ MVC (Model View Controller)</strong></h4>
<p><strong>MVC (Model View Controller) </strong>เป็นสถาปัตยกรรมซอฟแวร์ (software architecture) ที่มีการแบ่งแยกระบบออกเป็น 3 ส่วนหลักๆ ได้แก่ data model, user interface, and control logic ซึ่งทั้ง 3 ส่วนนี้มีการทำงานร่วมกัน</p>
<p><!--more--></p>
<p><span style="color:#0000ff;"><strong>ส่วนประกอบของ MVC</strong></span></p>
<ul>
<li>Model เป็นส่วนที่ทำงานติดต่อกับ database จัดการข้อมูลเข้า-ออก เพื่อนำไปประมวลผลต่อไป</li>
<li>View เป็นส่วนของการแสดงผลทาง Web browser อยู่ในรูปแบบของ HTML ซึ่งนำข้อมูลที่ได้มาจาก Model มาแสดงผลที่นี่</li>
<li>Controller เป็นส่วนของการประมวลผลหลักของระบบ ติดต่อกับ Web browser (user action) เพื่อส่งต่อให้ Model หรือ View ทำงานต่อไป</li>
</ul>
<p><strong><span style="color:#0000ff;">หลักการทำงานของ MVC</span></strong></p>
<ol>
<li>เมื่อ Client มีการร้องขอผ่าน View</li>
<li>ข้อมูลจะส่งผ่านไปหา Controller โดย Controller จะเป็นตัวจำแนก Action ต่างๆ หรือเป็น Business Logic ของระบบ</li>
<li>จากนั้น Controller ก็จะร้องขอไปยัง Model จาก Action นั้นๆ เช่น ร้องขอการเลือกข้อมูลทั้งหมดจากตาราง</li>
<li>เมื่อ Model รับการร้องขอก็จะทำการ Query ข้อมูลตามที่ Controller ส่งมา</li>
<li>Model จะส่งข้อมูลที่ได้กลับมาหา Controller</li>
<li>Controller ก็จะทำการ Set ค่าลงในตัวแปรเพื่อส่งให้ View ต่อไป</li>
<li>View ก็จะนำตัวแปรเหล่านั้นไปทำการแสดงผลตามต้องการได้</li>
</ol>
<div><span style="color:#0000ff;"><strong>ตัวอย่าง Web Application Framework ที่ใช้ MVC</strong></span></div>
<div>ภาษา Java</div>
<div>
<ul>
<li>Spring</li>
<li>Struts</li>
<li>Tapestry</li>
</ul>
<div>ภาษา PHP</div>
<div>
<ul>
<li>symfony</li>
<li>CakePHP</li>
<li>Canvas</li>
<li>Biscuit</li>
<li>CodeIgniter</li>
<li>Php on Trax</li>
</ul>
<div>ภาษา Python</div>
<div>
<ul>
<li>TurboGears</li>
<li>Django</li>
<li>Zope</li>
</ul>
<div>ภาษา Perl</div>
<div>
<ul>
<li>Catalyst</li>
<li>Maypole</li>
</ul>
<div>ภาษา Ruby</div>
<div>
<ul>
<li>RubyOnRails</li>
</ul>
</div>
<div>ที่มา : <a href="http://awarawut.blogspot.com/2010/08/cakephp-mvc.html" target="_blank">http://awarawut.blogspot.com/2010/08/cakephp-mvc.html</a></div>
</div>
</div>
</div>
</div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[A wild game loop appears!]]></title>
<link>http://niriel.wordpress.com/2011/08/19/a-wild-game-loop-appears/</link>
<pubDate>Fri, 19 Aug 2011 11:08:15 +0000</pubDate>
<dc:creator>Niriel</dc:creator>
<guid>http://niriel.wordpress.com/2011/08/19/a-wild-game-loop-appears/</guid>
<description><![CDATA[Figure 1: Game loop, I choose you! I told you in my previous posts that the physics would update at]]></description>
<content:encoded><![CDATA[<div id="attachment_205" class="wp-caption aligncenter" style="width: 330px"><a href="http://niriel.files.wordpress.com/2011/08/super_effective_game_loop.png"><img class="size-full wp-image-205" title="super_effective_game_loop" src="http://niriel.files.wordpress.com/2011/08/super_effective_game_loop.png?w=320&#038;h=288" alt="" width="320" height="288" /></a><p class="wp-caption-text">Figure 1: Game loop, I choose you!</p></div>
<p>I told you in my previous posts that the physics would update at 20 Hz while we would render frames at 60 Hz.  It is now implemented and available in the <a title="Download the zip." href="https://github.com/Niriel/Infiniworld/zipball/v0.0.6.b">v0.0.6.b</a> of Infiniworld.</p>
<p>There were two things to do:</p>
<ul>
<li>make the game loop smarter,</li>
<li>make the view able to interpolate.</li>
</ul>
<h1>Frame interpolation.</h1>
<p>If we update the frames three times faster than we update the physics, then we end up rendering three times the same scene with all the entities in the same positions, making our game look like it is rendered at 20 FPS instead of 60.  Nobody wants that.  To avoid this, we can modify the AreaView so that it can perform some interpolation between two physics states.</p>
<p>It felt immediately obvious to me that I should interpolate between the last known physics step and the next one.  Of course the next one hasn&#8217;t occurred yet, so I should predict it.  I can predict it for example by using a simple Euler integration: this is computationally cheap and noone is likely to notice any error on a time span of a twentieth of a second.  Then I realize it cannot work because it does not predict the collisions at all.  I need to run the full physics engine in order to have my predicted future. But that does not work either: I cannot predict what the user will do.  I can predict what the Entities will do by running their AI, but the player is a mystery.  And then, what ?  At the next time step I have to recompute the same physics step again, this time with the right player input.  This means that I run the physics twice for every step, and half of these computations give a wrong result because the player cannot be easily predicted.  It sounds like a bad idea doesn&#8217;t it?</p>
<p>When we try to guess the future we are not really interpolating, we are extrapolating.  And this, for the reasons given in the previous paragraph, will not work well.  What we should do is <strong>interpolating between two known physics steps in the past</strong>.  This has the strange consequence that the scene we render on the screen does not show the present state, but <strong>a state from a very close past</strong>.  This made me feel strange at the beginning, until I realized that we are talking about <strong>a delay of a sixtieth of a second, which nobody will notice</strong>.</p>
<p>I chose to apply a linear interpolation: we can compute it very fast and it looks good enough.  In short, it means that our entities are smoothly moving in straight lines between the positions given by the physics engine.  I could do some splines or fancy things, using more physics steps, but that would not look nicer.</p>
<div id="attachment_213" class="wp-caption aligncenter" style="width: 510px"><a href="http://niriel.files.wordpress.com/2011/08/game_loop_interpolation_timeline.png"><img class="size-full wp-image-213" title="game_loop_interpolation_timeline" src="http://niriel.files.wordpress.com/2011/08/game_loop_interpolation_timeline.png?w=500&#038;h=373" alt="" width="500" height="373" /></a><p class="wp-caption-text">Figure 2: We render frames using positions interpolated from the last two known physics steps.</p></div>
<p>The EntityView objects need to store three positions now: the position at the last physics state, the position before that, and an interpolated position.  The latter comes from this very simple line of code:</p>
<pre class="brush: python; title: ; notranslate" title="">
# Snippet from pygame_.EntityView.interpolatePosition
self.int_pos = (self.old_pos * (1 - ratio) + self.new_pos * ratio)
</pre>
<p>Each RenderFrameEvent now comes with a ratio.  We use this ratio to interpolate the position of all the EntityView sprites.  Then we draw the scene using these interpolated positions.</p>
<p><strong>Note that only the view does this: the model does not know anything about this interpolation.  Not a single line of code is changed in the model and its physics engine.</strong>  We respect our Model-View-Controller pattern.<strong><br />
</strong></p>
<h1>A smarter game loop.</h1>
<p>In order to feed the AreaView with a ratio for its interpolation, the game loop has to compute this ratio. But that&#8217;s not the only thing the game loop should do. It should:</p>
<ul>
<li>read the inputs from the keyboard/mouse/joypad/touchscreen but also from the network if we play online ;</li>
<li>run the physics ;</li>
<li>render the frames with the proper interpolation ratio.</li>
</ul>
<p>But that&#8217;s not it, it also should</p>
<ul>
<li>run the physics at a rate that does not depend on the speed of the machine, which means catching up if the rendering takes so much time we are getting late ;</li>
<li>have the highest FPS we can achieve, while still limiting it to what makes sense with the refresh rates of out monitors, independently from the physics ;</li>
<li>save some battery and keep the CPU cool by sleeping as much as we can.</li>
</ul>
<p>I am giving you here links to two very famous and well written articles about game loops:</p>
<ul>
<li><a href="http://www.koonsolo.com/news/dewitters-gameloop/">deWiTTERS Game Loop, by Koen Witters at Koonsolo</a></li>
<li><a href="http://gafferongames.com/game-physics/fix-your-timestep/">Fix Your Timestep!, by Glenn Fiedler at GafferOnGames</a></li>
</ul>
<p>They present various game loops and their behaviors on fast and slow hardwares.  That&#8217;s a good read for people who develop on PC and have to worry about guys like me who change their computer once every five years (and buy each time a cheapos one).  The loop I came up with looks pretty much like what they present at the ends of their articles: everything is independent from everything else, the physics is able to catch up when it&#8217;s getting late but even in that case it renders frames once in a while (better have horribly slow game than no game at all).  What I added is the possibility for the CPU to take a rest, and some protection against time jumps that the Network Time Protocol can cause on some machines.</p>
<p>There is a weird thing on the tubes&#8230;  I was wondering whether my game loop should sleep or not and <a href="http://www.gamedev.net/topic/445787-game-loop---free-cpu/">many people seemed to find perfectly normal to have the game loop eat ALL the CPU</a> (that&#8217;s just one source, I read that in several places).  Even Fiedler and Witters do that.  Why ?  I&#8217;ve seen screenshots of Minecraft with absurd frame rates (see Figure 3).  Do these people know that their monitor is limited at something like 60 Hz ?</p>
<div class="wp-caption aligncenter" style="width: 510px"><img src="http://ded.zenblue.net/minecraft_fps_gtx480.jpg" alt="" width="500" /><p class="wp-caption-text">Figure 3: Some dude running Minecraft at 556 FPS. Testosterone much?</p></div>
<p>At the old times of CRT monitors, 100 Hz was not a luxury, it was a need-to-have if you didn&#8217;t want to be staring at a stroboscope all day.  Believe me, I can see a refresh rate smaller than 100 Hz on a CRT.  But we have LCD/TFT/Plasma/dunnowhat monitors now where 60 Hz is perfectly healthy.  Why would you render 10 frames to only display one ?  Maybe it makes sense when you use accelerated graphics cards, but that&#8217;s still dumb.  It&#8217;s going to make your fans turn at full speed which is never pleasant to the ears and prevent you from playing in summer.  And if you are one of these weirdos who like playing with a laptop on battery in the train (or worse, a <a href="http://www.openpandora.org/">Pandora</a>!) you are pretty much doomed.</p>
<p>Now, sleeping is not super reliable, <a href="http://docs.python.org/library/time.html#time.sleep">we can wake up if a signal is sent to our process, or we may sleep a bit longer than we hoped</a>.  But I designed a game loop robust enough to handle change in speed, so let&#8217;s just do it!  I&#8217;ll put the CPU to sleep.</p>
<p>Here you can read the code of my game loop: <a href="https://github.com/Niriel/Infiniworld/blob/v0.0.6.b/src/loop.py">https://github.com/Niriel/Infiniworld/blob/v0.0.6.b/src/loop.py</a>.</p>
<h1>Conclusion.</h1>
<p>Figure 1 shows the new game loop in action: This picture is totally representative of what Infiniworld will look like in the end<a href="http://survivingtheworld.net/Lesson1130.html">{.}</a> Dear <a href="http://www.behance.net/Gallery/Periodic-Table-of-Typefaces/193759">font nerd</a> Pokémon fan: I know I didn&#8217;t use the right character font, that&#8217;s because I pixel-arted the text in the picture myself ; now, <a title="Read the second part of the article!" href="http://www.ocf.berkeley.edu/%7Ejdonald/pokemon/mewglitch.html">go glitch yourself a Mew</a>. Dear rest of the Universe, let this video blow your mind:</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/Z86V_ICUCD4?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
]]></content:encoded>
</item>
<item>
<title><![CDATA[The first screenshot of Infiniworld!]]></title>
<link>http://niriel.wordpress.com/2011/08/11/the-first-screenshot-of-infiniworld/</link>
<pubDate>Thu, 11 Aug 2011 12:21:15 +0000</pubDate>
<dc:creator>Niriel</dc:creator>
<guid>http://niriel.wordpress.com/2011/08/11/the-first-screenshot-of-infiniworld/</guid>
<description><![CDATA[Welcome back, fellow web traveler.  Here is, as I promised you in my previous post, the very first s]]></description>
<content:encoded><![CDATA[<p>Welcome back, fellow web traveler.  Here is, as I promised you in my <a title="Step 2: interactivity." href="http://niriel.wordpress.com/2011/08/09/step-2-interactivity/">previous post</a>, the very first screenshot of Infiniworld.</p>
<div id="attachment_98" class="wp-caption aligncenter" style="width: 310px"><a href="http://niriel.files.wordpress.com/2011/08/first_screenshot.png"><img class="size-medium wp-image-98" title="first_screenshot" src="http://niriel.files.wordpress.com/2011/08/first_screenshot.png?w=300&#038;h=188" alt="The first screenshot of Infiniworld." width="300" height="188" /></a><p class="wp-caption-text">Two entities (white) in the world (gray).  One of them can be moved around by the player.</p></div>
<h1>Game features:</h1>
<ul>
<li>Spawn your very own blocky creatures with a single key stroke (Enter/Return) !</li>
<li>Take control of your creatures and tell them where to go (WASD keys to move) !</li>
<li>A stunningly fluid 60 FPS refresh rate on any recent machine !</li>
<li>Save your battery life: the game sleeps when it has nothing to do !</li>
<li>Spy on yourself by logging everything you do into a file, and learn about what&#8217;s going on under the hood !</li>
</ul>
<p>Game does not feature:</p>
<ul>
<li>Physics engine.</li>
<li>Any kind of landscape.</li>
<li>Boobies and explosions (Actually they are in game, but only allegorically, just use your imagination).</li>
<li>Things to do.</li>
</ul>
<h1>Download and play this first interactive version of <em>Infiniworld</em> !</h1>
<p>GitHub link: <a href="https://github.com/Niriel/Infiniworld/tree/v0.0.2">https://github.com/Niriel/Infiniworld/tree/v0.0.2</a></p>
<h3>If you are a git user:</h3>
<pre class="brush: plain; title: ; notranslate" title="">
git clone git@github.com:Niriel/Infiniworld.git
</pre>
<h3>If you just want a zip:</h3>
<ul>
<li>Go there : <a href="https://github.com/Niriel/Infiniworld/">https://github.com/Niriel/Infiniworld/</a></li>
<li>Click on the big &#8220;Downloads&#8221; button on the right of the screen.</li>
<li>A window appears. Under &#8220;Download Packages&#8221;, click on v0.0.2.</li>
<li>That&#8217;s it, you have the zip !</li>
</ul>
<h1>Run the game.</h1>
<p>Enter the src directory and type &#8220;python solo.py&#8221;.</p>
<h1>Implementation.</h1>
<p>How does it all work ?  you ask.  Here is how:</p>
<ul>
<li>Model classes:  WorldModel, EntityModel.</li>
<li>View classes: PygameView, AreaView, EntityView.</li>
<li>Controller classes: PygameController, PlayerController, GameLoopController.</li>
</ul>
<h3>Models.</h3>
<p>The world is extremely simple for now.  There is no landscape, no map, no tiles.  It contains nothing but some <strong>entities</strong>.  I call &#8220;entity&#8221; anything that exists in the game world and can move: creatures, fireballs&#8230;</p>
<p>Entities are represented by an <strong>EntityModel</strong> class and have  a position stored as a two-dimensional vector (see geometry.Vector).  Each EntityModel has a unique <strong>entity_id</strong>.  Every event regarding a given entity will carry that entity_id. Today, the role of the EntityModel is to change its position when it is asked to do so.  Since there is no landscape and no physics engine, it always accept any order it receives.  That means that any <strong>MoveEntityRequest</strong> results in a <strong>EntityMovedEvent</strong>.</p>
<p>For now, the only responsibilities of <strong>WorldModel</strong> are to create and destroy EntityModel instances, and keep a list of them.</p>
<h3>Views.</h3>
<p>The <strong>PygameView</strong> is the root of everything that is displayed on the screen.  It opens the window and draws everything that needs to be drawn when it receives a <strong>RenderFrameEvent</strong>.</p>
<p>The <strong>AreaView</strong> displays a part of the world: landscape, entities.  There is no landscape so it just displays entities for now.  Each time AreaView receives an EntityCreatedEvent, it instantiates an <strong>EntityView</strong> object for representing it.</p>
<p>EntityView objects listen to the EntityMovedEvents to remain in sync with the EntityModel objects.</p>
<p>These views uses pygame.sprite for showing themselves on the screen.  The sprites of the EntityViews objects are blitted onto the sprite of the AreaView object, which is blitted onto the display by PygameView.  On the screenshot, the display is black, the AreaView is gray and the EntityViews are white.</p>
<h3>Controllers.</h3>
<p>The <strong>PygameController</strong> translates the pygame events (which are SDL events) into Infiniworld events.  For example, it translates the fact that Escape key is pressed into a <strong>QuitEvent</strong>.</p>
<p>The <strong>PlayerController</strong> contains an entity_id: the entity being controlled by the player.  When the PlayerController receives a <strong>PlayerMovedEvent</strong> from the PygameController, it responds by posting a MoveEntityRequest with the proper entity_id.</p>
<p>The last controller is the <strong>GameLoopController</strong>.  The current implementation is pretty naive and simple.  It posts a <strong>ProcessInputsEvent</strong> and a RenderFrameEvent 60 times per second.  ProcessInputEvent wakes up the PygameController and RenderFrameEvent wakes up the PygameView.  Note that the GameLoopController does not use any pygame function, so it does not call pygame.time.clock for running at 60 FPS.  Instead, it uses the time module from the standard library.  The game loop stops when the GameLoopController receives a QuitEvent.</p>
<h1>What next ?</h1>
<p>The goal of this demo was to have something interactive as quickly as I could.  It works: I can create entities and move them around.  But it&#8217;s not pretty: the entities are teleported, it is not fluid at all.  It would be nice to have a physics engine.  However, a physics engine should manage collisions, and I do not have much to collide against for now.  I need a landscape.  So I think that the next step is to implement tiles, maps, areas, etc..</p>
<p>The WorldModel will hold many AreaModel instances in memory: dungeons floors, cities, overworld, etc..  The EntityModel needs to be extended to accomodate the fact that there are now several areas.  The AreaView should show one area only.  Entities should be able to move from one area to another.  Lots of work to do !</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Step 2: interactivity.]]></title>
<link>http://niriel.wordpress.com/2011/08/09/step-2-interactivity/</link>
<pubDate>Tue, 09 Aug 2011 12:48:13 +0000</pubDate>
<dc:creator>Niriel</dc:creator>
<guid>http://niriel.wordpress.com/2011/08/09/step-2-interactivity/</guid>
<description><![CDATA[In the previous article I explained how I implemented the event management. Now, our software bricks]]></description>
<content:encoded><![CDATA[<p>In the previous article I explained how I implemented the event management. Now, our software bricks can talk to each other. Let&#8217;s get them to talk ! Well&#8230; let&#8217;s get them, first.  We need bricks.  The good ones.</p>
<p>Too often I started similar projects, focusing on an aspect such as the procedural landscape generation. It worked ! But I got stuck. I ended up with an ASCII dump of something representing a world, but I couldn&#8217;t do anything with it.  There was no game built to explore that world.  This time I want to start making the game interactive in the first place: we need to be able to explore before having something to explore.</p>
<p>I chose <a href="http://www.pygame.org/docs/">pygame</a> for managing the input and the output.  The input being the player&#8217;s fingers on a keyboard/mouse/joypad, and output being the screen and loud speakers reaching the player&#8217;s eyes and ears.  Because I apply some kind of Model-View-Controller (I always say &#8220;some kind&#8221; because everyone has his own MVC), I will wrap the input in a Controller, and the output in a View.</p>
<p>We will have a PygameController and a PygameView class.  I don&#8217;t want to use anything related to pygame in the Model classes, to make sure that when I decide to use a different rendering engine I only have to rewrite the input and output without touching the game logic at all.  There will probably many other pygame-related views, probably one view per character to be displayed, for example.  These views will be managed by the main PygameView.  It would be wise to group everything pygame-related in one single package so that it can be replaced.  Other views, like a console view for the server, would be kept in another package.</p>
<p>And, finally, we&#8217;ll need a game loop.  I&#8217;ll go for the simplest game loop ever, but in a near future I shall write a whole entry on the subject.</p>
<p>Let&#8217;s get to work ! Very soon, the first screenshot !  I bet you can&#8217;t wait <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[The event management is in place.]]></title>
<link>http://niriel.wordpress.com/2011/08/08/the-event-management-is-in-place/</link>
<pubDate>Mon, 08 Aug 2011 17:23:58 +0000</pubDate>
<dc:creator>Niriel</dc:creator>
<guid>http://niriel.wordpress.com/2011/08/08/the-event-management-is-in-place/</guid>
<description><![CDATA[Hello hello ! As promised I worked on what I called &#8220;Event Management&#8221;, the bare bones o]]></description>
<content:encoded><![CDATA[<p>Hello hello !</p>
<p>As promised I worked on what I called &#8220;Event Management&#8221;, the bare bones of my lousy implementation of the Model-View-Controller pattern.  It&#8217;s uploaded on GitHub :</p>
<p><a href="https://github.com/Niriel/Infiniworld/tree/v0.0.1">https://github.com/Niriel/Infiniworld/tree/v0.0.1</a></p>
<p>The important module is <em>evtman.py</em>, &#8220;evtman&#8221; standing for &#8220;Event Management&#8221;.  It contains three classes:</p>
<ul>
<li>Event</li>
<li>Listener</li>
<li>EventManager</li>
</ul>
<div id="attachment_40" class="wp-caption aligncenter" style="width: 593px"><a href="http://niriel.files.wordpress.com/2011/07/mvc1.png"><img class="size-full wp-image-40" title="Event Manager, events and Listeners." src="http://niriel.files.wordpress.com/2011/07/mvc1.png?w=583&#038;h=269" alt="Event Manager, events and Listeners." width="583" height="269" /></a><p class="wp-caption-text">The Listeners communicate only with Events that transit through an Event Manager.</p></div>
<p>The classes Event and Listener are abstract, and are meant to be subclassed. The Event class looks a bit complicated, but that&#8217;s because it automatizes things in order to make its subclasses extremely easy to define. For example :</p>
<pre class="brush: python; title: ; notranslate" title="">
&#62;&#62;&#62; class CharacterMovedEvent(Event):
...     name = &#34;Character Moved Event&#34;
...     attributes = ('character_id', 'position_from', 'position_to')
...
&#62;&#62;&#62; event = CharacterMovedEvent('Bunny', (0, 0), (32, 0))
&#62;&#62;&#62; print event.character_id
Bunny
&#62;&#62;&#62; print event.position_to
(32, 0)
&#62;&#62;&#62; print repr(event)
CharacterMovedEvent(character_id='Bunny', position_from=(0, 0), position_to=(32, 0))
&#62;&#62;&#62; print str(event)
Character Moved Event
    character_id = 'Bunny'
    position_from = (0, 0)
    position_to = (32, 0)
</pre>
<p>See ? Very easy. Now that I think of it, the <em>name</em> attribute should go away because it&#8217;s pretty useless; I put it there to have a clean human-readable name but the class name is enough.  I made sure that <em>repr</em> would not lead to insanely long lines by capping at 50 characters per attribute.  Very useful when events carry a complete dungeon map in a huge list/dictionary/tuple/whatever.</p>
<p>It is also very easy to subclass Listeners:</p>
<pre class="brush: python; title: ; notranslate" title="">
class CharacterView(Listener):
    def __init__(self, character_id):
        self._character_id = character_id
        self._x = self._y = 0
    def onCharacterMovedEvent(self, event):
        if event.character_id == self._character_id:
            # 32 pixels per meter, and the display starts at
            # the bottom while my Y axis goes up.
            self._x = event.position_to[0] * 32
            self._y = 480 - event.position_to[1] * 32
</pre>
<p>That&#8217;s it, you have your View.  It should be a pygame Sprite, the zoom level (32) and the window size (480) should not be hardcoded here, but that&#8217;s not more complicated than that.</p>
<p>And to use it is very simple:</p>
<pre class="brush: python; title: ; notranslate" title="">
def example():
    class CharacterMovedEvent(Event):
        attributes = ('character_id', 'position_from', 'position_to')
    class CharacterView(Listener):
        def __init__(self, character_id):
            self._character_id = character_id
            self._x = self._y = 0
        def __str__(self):
            return &#34;%s: pos = (%i, %i)&#34; % (self._character_id,
                                           self._x, self._y)
        def onCharacterMovedEvent(self, event):
            if event.character_id == self._character_id:
                self._x = event.position_to[0] * 32
                self._y = 480 - event.position_to[1] * 32
    #
    bunny_view = CharacterView('bunny')
    hamster_view = CharacterView('hamster')
    event_manager = EventManager()
    event_manager.register(bunny_view)
    event_manager.register(hamster_view)
    #
    event = CharacterMovedEvent('bunny', (0, 0), (1, 2))
    event_manager.post(event)
    event_manager.pump()
    #
    print bunny_view
    print hamster_view
</pre>
<p>And the result is:</p>
<pre>bunny: pos = (32, 416)
hamster: pos = (0, 0)</pre>
<p>There is one thing missing, though: some Listeners may want to post events. For example, the CharacterModel is a Listener which should be able to post the CharacterMovedEvent. This is achieved by giving the event manager to the listener. Add this to the previous code:</p>
<pre class="brush: python; title: ; notranslate" title="">
    class CharacterModel(Listener):
        def __init__(self, event_manager, character_id):
            Listener.__init__(self)
            self._event_manager = event_manager
            self._character_id = character_id
            self._x = self._y = 0
        def moveTo(self, new_x, new_y):
            old_x = self._x
            old_y = self._y
            self._x = new_x
            self._y = new_y
            event = CharacterMovedEvent(self._character_id, (old_x, old_y), (new_x, new_y))
            self._event_manager.post(event)

    hamster_model = CharacterModel(event_manager, 'hamster')
    event_manager.register(hamster_model)
    hamster_model.moveTo(3, 3)
    event_manager.pump()
    print hamster
</pre>
<p>Result:</p>
<pre>    hamster: pos = (96, 384)</pre>
<p>In this example, the model doesn&#8217;t listen to anything, but in a real situation it would.</p>
<div id="attachment_40" class="wp-caption aligncenter" style="width: 510px"><br />
<a title="Hero Quest, the toughest monster of all. by Niriel, on Flickr" href="http://www.flickr.com/photos/niriel/5633683485/"><img src="http://farm6.static.flickr.com/5030/5633683485_ac675914cd.jpg" alt="Hero Quest, the toughest monster of all." width="500" height="375" /></a><p class="wp-caption-text">HamsterView moving on the tile map and destroying Orcs as a response to a GoBerserkEvent.</p></div>
<p>That&#8217;s all there is to it ! It just works.</p>
<p>Just don&#8217;t forget to unregister the Listeners you don&#8217;t use any longer:</p>
<pre class="brush: python; title: ; notranslate" title="">event_manager.unregister(hamster_view)</pre>
<p>Sure the event_manager keeps only Weak References to the Listeners, so they automatically disappear from its lists. But if they disappear right in the middle of an iteration, that may explode. If you see such an explosion, it means you forgot to properly unregister.</p>
<p>A last word: you can post as many events as you want. They will all be processed, in the order you posted them, when you call the <em>pump</em> method of the event manager. Some event handlers will post events, even register new Listener. That is perfectly okay, the event manager is happy with that, the pump will go on until the event queue is empty.</p>
<h3>EDIT:</h3>
<ul>
<li>I got rid of the &#8216;name&#8217; variable of events.  It was 100 % useless.</li>
<li>I introduced a SingleListener class, which is for Listeners that are interested in ONE event manager only.  And to be fair, that&#8217;s the case most of the time.</li>
</ul>
<p>&#160;</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Who controls the controllers?]]></title>
<link>http://niriel.wordpress.com/2011/08/06/who-controls-the-controllers/</link>
<pubDate>Sat, 06 Aug 2011 21:35:10 +0000</pubDate>
<dc:creator>Niriel</dc:creator>
<guid>http://niriel.wordpress.com/2011/08/06/who-controls-the-controllers/</guid>
<description><![CDATA[The Model-View-Controller pattern is quite a wonderful thing.  I had some troubles accepting it beca]]></description>
<content:encoded><![CDATA[<p>The Model-View-Controller pattern is quite a wonderful thing.  I had some troubles accepting it because I was born at a time when <a href="http://en.wikipedia.org/wiki/Cray-1">the most powerful computer in the world had 8 Mb of RAM and a CPU beating at 80 MHz</a>.  I still feel a squeeze in my heart when I write an <em>if</em> statement inside a <em>for</em> loop, so I found it hard to accept replacing function calls with messages broadcast all over the place to components that don&#8217;t care.  To me, it&#8217;s like taking all the axones away from a nervous system and ask the hormones to replace them in their job:  a tremendous waste of memory and CPU.  But memory and CPU are cheap now, and my ambitions are relatively modest from a performance point of view.  So I gave in and am now a happy man.</p>
<p>I won&#8217;t spend much time describing it because others have done it quite nicely before me.  I really urge you to read the following articles if you don&#8217;t really know what it&#8217;s about.</p>
<ul>
<li><a href="http://ezide.com/games/writing-games.html">sjbrown&#8217;s Writing Games Tutorial</a></li>
<li><a href="http://www.koonsolo.com/news/model-view-controller-for-games/">Game Architecture: Model-View-Controller, by Koonsolo</a></li>
</ul>
<p>The idea is to separate the</p>
<ul>
<li>game logic &#8211;or Models&#8211; (physics engine, position of the characters, tiles in the map)</li>
<li>from the way it is presented &#8211;by Views&#8211; (sprites on the screen, debugging console, a bit of network code that sends the info to the client who is the one doing the actual rendering)</li>
<li>and from the way it is controlled &#8211;by Controllers&#8211; (keyboard, mouse, clock, network sending info from a client or a server).</li>
</ul>
<p>This makes developing our game a bit like playing with Lego bricks: adding or removing a brick does not interfere with anything.  Models Views and Controllers send Events to an Event Manager which takes care of forwarding them to other Models Views and Controllers.</p>
<p>So who controls the Controllers ? The Event Manager does. It also manages the Views and the Models.</p>
<div class="wp-caption aligncenter" style="width: 328px"><a title="Dr. Manhattan by polywen, on Flickr" href="http://www.flickr.com/photos/artpoly/2846354516/"><img src="http://farm4.static.flickr.com/3164/2846354516_9bc0838a9e.jpg" alt="Dr. Manhattan" width="318" height="500" /></a><p class="wp-caption-text">And HE watches the Event Manager.</p></div>
<p>For example, the server does not need to display anything, only the client does.  So you just delete all the graphic Views from the server code.  You can plug a console View that shows the server load if you want.  An other example: if you want to replace my PyGame 2D view by some 3D OpenGL magic, go for it.  The game logic does not care one bit.  This is all very well described in the two articles I linked up there.</p>
<p><strong>However</strong>, I would like to add a few things in this post.</p>
<p>Brown&#8217;s implementation does not scale very well.  It works perfectly of course and has the immense advantage of being very easy to understand, which is exactly why Brown chose this implementation for writing his tutorial.  But when you look at it, 1) every Event is sent to every Listener (Model View or Controllers) ; 2) from there, a bunch of if statements will decide how the Listener will react, if it reacts at all because in many occasions the Listener doesn&#8217;t even care about that type of Event.  Stone me for optimizing early, but it could be interesting to have the Listener specify which kind of events they are interested in (solving problem 1), and give to the Event Manager a direct handle to the code that should react to it, instead of filtering with <em>if</em>s (solving problem 2).</p>
<p>Both Brown and Koonsolo apply the traditional MVC pattern which allows the View to know something about the Model.  For example, the DragonSprite View really has a pointer to the DragonCharacter Model.  I don&#8217;t think I&#8217;ll do that.</p>
<p>The Model sure ignores the View but the View knows about the model.  This asymmetry feels dirty to me.  It&#8217;s almost an invitation to modify the Model from the View, which is a bad thing.  But even if you behave, I am still annoyed by having to carry full objects in my Events.  For example, the MonsterAppearedEvent will have to carry the DragonCharacter object so that the DragonSprite be created and points to it.  That complicates the serialization when you need to carry Events over the network and that makes debugging a mess.  First, too many pointers and references: you don&#8217;t know who owns who, and if you use WeakRefs in the View to avoid memory leaks you&#8217;ll end up with broken pointers.  Second, when you print an event into a log file it doesn&#8217;t help you at all because the CharacterMovedEvent does not tell you where the character moved ; indeed the View just has to look into its model to get the info.  Third, it becomes difficult to test the View without testing the Model itself.</p>
<p>Does the Sprite really need to know the whole Model ?  Of course not.  If the Model moves, then the sprite just needs to know the new position, and this position can be stored into the CharactedMovedEvent.</p>
<p>One advantage I can see when one sends the full Model is that the View can initialize itself in one go.  When the View is created, it knows already everything about the model and can display it properly at the right place.  But we can also do it with events.  You can have the CharacterCreatedEvent contain enough info for the View to initialize itself.  And if it&#8217;s still not enough, the View can post a CharacterPositionRequest Event and wait for the Model to answer with a CharacterPositionEvent Event.</p>
<p>What I&#8217;m going for is not traditional MVC, I&#8217;ll use Events all the way.  Which means that there is no real difference between a Model, a View and a Controller, at least not from an implementation point of view.  They&#8217;re all Listeners, waiting for events to tickle them and posting events when they feel like it.  However, what I&#8217;m not doing, is having all the Models talking to each other through events.  I want to separate Model, View and Controller, I don&#8217;t want to separate the model from itself unless there&#8217;s a very good reason to do so.  Can&#8217;t think of any right now.</p>
<p>So I&#8217;ll be working on that.  I&#8217;ll tell you when it&#8217;s pushed on GitHub!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[How to use Model-View-Controller (MVC)]]></title>
<link>http://nuwan4u.wordpress.com/2011/07/02/how-to-use-model-view-controller-mvc/</link>
<pubDate>Sat, 02 Jul 2011 06:30:26 +0000</pubDate>
<dc:creator>Nuwan</dc:creator>
<guid>http://nuwan4u.wordpress.com/2011/07/02/how-to-use-model-view-controller-mvc/</guid>
<description><![CDATA[In the MVC paradigm the user input, the modeling of the external world, and the visual feedback to t]]></description>
<content:encoded><![CDATA[<p><a href="http://nuwan4u.files.wordpress.com/2011/07/mvc-applied-servlet.gif"><img class="alignnone size-full wp-image-2136" title="MVC-Applied-Servlet" src="http://nuwan4u.files.wordpress.com/2011/07/mvc-applied-servlet.gif?w=464&#038;h=435" alt="" width="464" height="435" /></a></p>
<p>In the MVC paradigm the user input, the modeling of the external world, and the visual feedback to the user are explicitly separated and handled by three types of object, each specialized for its task. The <strong>view</strong> manages the graphical and/or textual output to the portion of the bitmapped display that is allocated to its application. The <strong>controller</strong> interprets the mouse and keyboard inputs from the user, commanding the model and/or the view to change as appropriate. Finally, the <strong>model</strong> manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller). The formal separation of these three tasks is an important notion that is particularly suited to Smalltalk-80 where the basic behavior can be embodied in abstract objects: <em>View</em>, <em>Controller, Model</em> and <em>Object</em>. The MVC behavior is then inherited, added to, and modified as necessary to provide a flexible and powerful system.</p>
<p>&#160;</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ASP.NET MVC3]]></title>
<link>http://blog.gisinc.com/2011/06/29/asp-net-mvc3/</link>
<pubDate>Wed, 29 Jun 2011 17:25:54 +0000</pubDate>
<dc:creator>bentondtaylor</dc:creator>
<guid>http://blog.gisinc.com/2011/06/29/asp-net-mvc3/</guid>
<description><![CDATA[I recently had the opportunity to delve into Microsoft’s ASP.NET MVC3 Framework. Although various ve]]></description>
<content:encoded><![CDATA[<p>I recently had the opportunity to delve into Microsoft’s ASP.NET MVC3 Framework. Although various versions of the framework have been around for several years now, I haven’t had the chance to explore the intricacies of technology until now.</p>
<p>The framework centers around the age-old Model-View-Controller (MVC) design pattern which, in and of itself, is a fairly simplistic concept. The pattern is designed to enforce a clean and logical separation between your business layer and UI. This segregation is accomplished by keeping data and business logic within the model and all UI logic and components within the view. The controller acts as a middle-man, facilitating the communication between the model and view. It takes input from the view and applies the appropriate actions against the model and then passes the results back to the view.</p>
<p>MVC’s knack for separating business and presentation layers helps ensure that the UI is totally disposable. You don’t have to worry about losing some important business rule that somehow slipped its way into the UI layer of your application.</p>
<p>The design pattern also promotes parallel development. For instance, you can stud out a model and a back-end developer can work on hydrating that model with data. In the meantime a UI developer can work on the front-end against the same preliminary model, hopefully meeting in the middle with a finished product.</p>
<p>The clean separation can also simplify application maintenance and enhancement. Changes in one component of the pattern are isolated to that component itself which opens itself up to easier unit testing.</p>
<p>The ASP.NET MVC3 framework provides the developer who has chosen to create an application using the MVC pattern, a quick and intuitive means to a finished product. It’s important to note that if you choose to use the framework, you are committed to work within the confines of the MVC pattern. There is not much wiggle room for coding outside of the pattern and in reality shouldn’t be. However, once you’ve decided to take the plunge and use the framework, you’ll find that it is fairly easy to stick to the MVC paradigm and, in most cases, harder to go astray.</p>
<p>The framework is designed to lean more toward using convention rather than configuration. As a result, your application will have clean and user-interpretable URLs. For instance, let’s take the following URL: <a href="http://hellomvc/foo/bar">http://helloMVC/foo/bar</a> and see how the framework would interpret this request.  In this example, <em>helloMVC</em> is just the application name, <em>foo</em> is the controller and <em>bar </em>is the name of the action method within the <em>foo</em> controller that would perform any interactions, if any, against the model. By convention, you would also have a view named <em>bar</em>. The framework inherently knows to display <em>bar </em>view when the <em>bar</em> action method is called. This is all accomplished by a routing table that is setup in your Global.asax.cs. In the example above we are using the default route which the framework automatically generates when a new project is created. However, you have the option to create your own URL route patterns to fit your needs.</p>
<p>A major difference between MVC3 and traditional web form programming is the absence of code behind files associated with your web pages and controls. In MVC3, any presentation logic that is required is coded in-line within the html blocks that make up your view. So you don’t have to hop back and forth between an aspx and aspx.cs or plow through JavaScript to control the behavior of a given element. You’re presentation logic is wrapped around the element itself. This is made possible by MVC3 use of view engines. View engines are precompiled modules that implement a certain coding template and there are a multitude of them available. Most, if not all, are open source. And which one you choose is totally up to you and your particular coding style. Some view engines are very terse while others are more robust in their syntax. MVC3 ships with a view engine called Razor and it’s the view engine I’m most familiar with. Razor syntax has a strong resemblance to traditional html so most developers will find it very easy to pick up and run with.</p>
<p>In addition to in-line presentation logic, the view engine also allows the developer to interact with the model data passed from the controller. This functionality becomes particularly useful when coupling the framework with ESRI’s JavaScript API. Model data can be accessed directly within a given JavaScript function to be displayed on the map. And conversely, data can easily be captured from user input on the map and be passed back to the controller to update the model.</p>
<p>I found the MVC3 framework as whole fairly easy to use and implement. I see it more suited for new development. However, it would be difficult to try and incorporate the framework in an existing application because to you really have to commit to the MVC design pattern in order to use it. There isn’t anything you can do with this framework that you can’t accomplish using traditional web forms. But MVC seems to be picking up some steam over the past couple of years. The design pattern itself popped up a few times during this year’s ESRI Dev summit. So it may be a good technology to be aware of and keep your eye on.  If you’re interested in learning more or trying out the framework yourself, you can check out <a href="http://www.asp.net/mvc/mvc3">http://www.asp.net/mvc/mvc3</a>. It’s a great resource and jumping off point for anyone interested in using MVC3.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[#WordPress MVC Framework]]></title>
<link>http://ariffst.wordpress.com/2011/06/27/wordpress-mvc-framework/</link>
<pubDate>Mon, 27 Jun 2011 15:30:00 +0000</pubDate>
<dc:creator>Arif Setiawan</dc:creator>
<guid>http://ariffst.wordpress.com/2011/06/27/wordpress-mvc-framework/</guid>
<description><![CDATA[WordPress MVC Framework View more presentations from Yohan Totting -6.975612 107.630943]]></description>
<content:encoded><![CDATA[WordPress MVC Framework View more presentations from Yohan Totting -6.975612 107.630943]]></content:encoded>
</item>
<item>
<title><![CDATA[Senior Front-End/User Interface Developer (Full-Time OR Contract-to-Hire) 2 POSITIONS! - Midtown Manhattan, NYC]]></title>
<link>http://itmediajobsnyc.wordpress.com/?p=377</link>
<pubDate>Tue, 07 Jun 2011 20:59:17 +0000</pubDate>
<dc:creator>itmediajobsnyc</dc:creator>
<guid>http://itmediajobsnyc.wordpress.com/?p=377</guid>
<description><![CDATA[Senior Front-End/User Interface Developer LOCATION: Midtown Manhattan, NYC TERMS: Full-Time INDUSTRY]]></description>
<content:encoded><![CDATA[Senior Front-End/User Interface Developer LOCATION: Midtown Manhattan, NYC TERMS: Full-Time INDUSTRY]]></content:encoded>
</item>
<item>
<title><![CDATA[Django, CakePHP and CodeIgniter, part 4: the Model-View-Controller or Model-Template-View interactions]]></title>
<link>http://apprenticecoder.wordpress.com/2011/06/03/django-cakephp-and-codeigniter-part-4-the-model-view-controller-or-model-template-view-interactions/</link>
<pubDate>Fri, 03 Jun 2011 13:39:26 +0000</pubDate>
<dc:creator>apprenticecoder</dc:creator>
<guid>http://apprenticecoder.wordpress.com/2011/06/03/django-cakephp-and-codeigniter-part-4-the-model-view-controller-or-model-template-view-interactions/</guid>
<description><![CDATA[I&#8217;m back in the world of frameworks. So, I&#8217;m continuing the series, restarting from the]]></description>
<content:encoded><![CDATA[<p>I&#8217;m back in the world of frameworks. So, I&#8217;m continuing the series, restarting from the very basics, and that would clearly be the model-view-controller pattern. This post is not a brilliant triple tutorial which explains in great synthesis everything you need to know about MVC in all three frameworks (Django, CakePHP and CodeIgniter) at once. Some day I will be able to write things such as that, but not today. Today I am just an apprentice, and here are some of my study notes.</p>
<p>So, CodeIgniter is very nice and flexible and makes it easy to grasp these concepts, since you can initially have only the controller, and then add a view, and in the end, maybe even a model. Very Lego-like. Django have their own methodology of not having a methodology. And they call that MTV, model view template. To them the model is the application itself, in a way. CakePHP relies very much on convention and file naming. To read more on the subject, click &#8220;Continue reading&#8221;.<!--more--><strong>HELLO WORLD OF MVC</strong></p>
<p>CodeIgniter is great for studying the Model-View-Controller structure of these frameworks. Because it applies it, of course. And also <strong>because with CodeIgniter you don&#8217;t even need a Model to start with.</strong> You can put together a simple &#8220;Hello World&#8221; Controller-View test case, and see what happens. If you want to go even more minimal, you can start with just the Controller.</p>
<p>So, what does the CodeIgniter Controller do? Exactly as its name suggests. <strong>The controller controls.</strong> It controls a good part of what happens between a web page being requested and the response being displayed. It doesn&#8217;t do everything, of course, the Web Server is still there, doing it&#8217;s job, handling the Requests and the Responses. The web application, in this case with the help of a framework, puts together the web pages that need to be sent with the Response. By the Server.</p>
<p>So, when you download the CodeIgniter 2 files onto your server and your server displays a nice encouraging <strong>Welcome message</strong>, it will tell you that the Controller that makes that happen is <strong>application/controllers/welcome.php</strong> and the view that is handling the presentation of what you are seeing is application<strong>/views/welcome_message.php</strong>. So, let&#8217;s take a look.</p>
<p>The controller just loads the view.</p>
<pre>class Welcome extends CI_Controller {
       public function index()
        {
                #echo 'welcome';
                $this-&#62;load-&#62;view('welcome_message');
        }
}</pre>
<p>As you can see, for testing purposes, <strong>we could even skip the view and just echo some text</strong>. The simplest view is just a file containing a basic HTML page that can echo the PHP variables that the controllers passes it.</p>
<p>And the variables, that is <strong>the page content, usually comes from the model</strong>. Which usually gets it from the database. Using the Active record <strong>object-relational mapping</strong>, so you can interface yourself to the database through objects, instead of writing queries. In reality, the <strong>model could do much more</strong> then just the basic CRUD (database input and output). The model is the very logic of a web application, the business and otherwise logic, the brain. And I hope to someday see it in real action.</p>
<p>And what happens behind the scenes? Good question. I still haven&#8217;t explored the CodeIgniter source code much, certainly not enough. But even an apprentice like me can tell you that if you ask for <strong><a href="http://example.com/codeigniter/" rel="nofollow">http://example.com/codeigniter/</a></strong> the Web Servers calls upon the<strong> index.php</strong> script, by default (I&#8217;ve already written about mod_rewrite in another post). Just open the index.php with your favorite text editor, and peek inside. You&#8217;ll see that it does some environment setting up, and then <strong>calls the bootstrap script</strong>, at  BASEPATH plus &#8216;core/CodeIgniter&#8217; plus EXT. If you echo or log that to see what is going on, you see that the bootstrap script can be found in your your CodeIgniter directory and more specifically in <strong>system/core/CodeIgniter.php</strong>. Why not read that too? Again we have some defining and requiring, and a lot of creating of instances of classes and such. So a fun thing to do is to look at the objects being created, printing them out with  var_dump or whatever. For example, with echo <strong>&#8220;&#60;pre&#62;&#8221;; var_dump($RTR); echo &#8220;&#60;/pre&#62;&#8221;</strong>; you get a view of the routing class, which I think is the one which knows what controller to load and from where.</p>
<p>And of course, silly me, forgot to mention, this is because there is a file <strong>application/config/routes.php</strong> that defines what will happen when users asks for certain URLs, and out of the box it knows that it needs to welcome you, the very first user, with the welcome message. For the routes.php file contains this:</p>
<pre>$route['default_controller'] = "welcome";
$route['404_override'] = '';</pre>
<p>Is this at all clear? Some day I will put together proper tutorials explaining all of this very clearly and very schematically, right now I am just learning and all I&#8217;ve got to share are some notes I&#8217;m taking along the way.</p>
<p><strong>DJANGO&#8217;S PHP</strong></p>
<p>Django is different. It&#8217;s not MVC at all, it&#8217;s MTV. <a title="Django MTV explanation" href="http://docs.djangoproject.com/en/1.3/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names">Here&#8217;s an explanation</a>: with Django, the view is about which information gets presented to the user, the template is about how it gets presented.<strong> &#8220;If we have a methodology, it&#8217;s that we are anti-methodology&#8221;</strong>, as Django&#8217;s Jacob Kaplan-Moss declares in this <a title="Django Google Tech Talk" href="http://www.youtube.com/watch?v=p-WXiqrzAf8">Google Tech Talk in 2006</a> (at about 13 mins). &#8220;A model is a blueprint for your data, it describes everything that there is about your data&#8221;, Jacob explains. Data is both data and metadata (stuff that &#8220;doesn&#8217;t fit into your database&#8221;). But let&#8217;s not get carried away. <strong>What happens to the Controller? It appears to be a bit all over the place in Django.</strong> Where does the “controller” fit in, then? Accordingly to the above quoted FAQ, &#8220;<strong>it’s probably the framework itself:</strong> the machinery that sends a request to the appropriate view, according to the Django URL configuration.&#8221; And the view can call upon the model data directly, as <a title="Django tutorial" href="http://docs.djangoproject.com/en/1.3/intro/tutorial04/">we see in the tutorial</a>. Clearly, Django it&#8217;s not as messy as it may sound. It is orderly in its own way.</p>
<p><strong>CAKEPHP&#8217;S MVC</strong></p>
<p>What about CakePHP? It follows the Model-View-Controller pattern, as <a title="CakePHP MVC" href="http://book.cakephp.org/view/892/Basic-Principles-of-CakePHP#!/view/890/Understanding-Model-View-Controller">you can read here</a>. How exactly? CakePHP likes &#8220;<strong>convention over configuration</strong>&#8220;, so models, views and controllers have to have certain names, and will automatically work together.</p>
<p>As we can see in the c<a title="Basic CakePHP blog tutorial" href="http://book.cakephp.org/view/1528/Blog">lassical basic blog tutorial</a>, after you have created a database, adjusted its configuration file and dealt with some mod_rewrite issues, the basic model is a php file that lives in <strong>app/models</strong> and has a name that describes what it does, like <strong>post.php</strong> which handles the posts in out blog. It would contain a class called Post. There would be a controller <strong>/app/controllers/posts_controller.php</strong> with a class called <strong>PostsController</strong>, which uses HTML helpers and calls a view, and grabs contents from a database with a <strong>simple $this-&#62;Post-&#62;find(&#8216;all&#8217;)</strong>. The view is the /app/views/posts/index.ctp template file, and is the usual mix of HTML and PHP variable printing.</p>
<p>This post is already too long, so I&#8217;ll end it here. There are other fun things to consider, such as helpers, behaviours, components, and will be done some other time. Have fun, and sorry that this post is not yet the tutorial that someday I will be able to write. But be patient with this particular apprentice, which is me, and I promise to improve daily. Wish you a nice day!</p>
<p><a href="https://apprenticecoder.wordpress.com/2011/01/14/no-more-static-web-sites/" target="_blank">0) No More Static Web Sites (learning from mistakes #1)</a><br />
<a href="http://apprenticecoder.wordpress.com/2011/01/31/django-vs-cakephp-vs-codeigniter-part-1-installation/" target="_blank">1) part 1 : downloading – planting the framework tree</a><br />
<a href="../2011/02/09/frameworks-part-2-server-talks-to-framework/#mod_rewrite">2) part 2: how does the server talk to the framework?</a><br />
<a href="../2011/03/06/django-cakephp-and-codeigniter-part-3-models-data-relationships-and-foreign-keys/">3) Django, CakePHP and Codeigniter, part 3: Models, data, relationships and foreign keys</a><br />
4) Django, CakePHP and CodeIgniter, part 4: the Model-View-Controller or Model-Template-View interactions<br />
<a href="../2011/08/01/objects-in-frameworks-those-who-get-the-work-done-codeigniter-notes/"><br />
5) Objects in frameworks &#8211; those who get the work done &#8211; CodeIgniter notes</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Computational models as life skill, the Bruce Schneier perspective]]></title>
<link>http://apprenticecoder.wordpress.com/2011/05/24/computational-models-as-life-skill-the-bruce-schneier-perspective/</link>
<pubDate>Tue, 24 May 2011 22:08:46 +0000</pubDate>
<dc:creator>apprenticecoder</dc:creator>
<guid>http://apprenticecoder.wordpress.com/2011/05/24/computational-models-as-life-skill-the-bruce-schneier-perspective/</guid>
<description><![CDATA[You have probably been running into the concept of the Model if you have anything to do with web dev]]></description>
<content:encoded><![CDATA[<p>You have probably been running into the concept of the Model if you have anything to do with web development, or programming in general. We have our Model-View-Controller pattern, which I have mentioned when writing about web frameworks. But that&#8217;s not all. When I was watching the MIT Open Course Ware lectures I learned that basically <strong>programming as such is based on <a title="MIT Open Course Ware, mapping the world into something computational" href="http://apprenticecoder.wordpress.com/2011/02/15/mit-600-part-1-mapping-world-to-something-computational/">mapping the world into something computational</a>. We choose some aspects of the world to measure, to map, and concentrate on those.</strong> And that got me thinking &#8211; what if mapping into something &#8220;computational&#8221;, creating models, was a life skill? For instance, when I was finding myself in complicated situations, trying to sift out through intuitions, facts, observations, deceptions and strategies. what I ended up telling myself was &#8211; create a model. <strong>I told myself &#8211; pick some really important variables to follow, and concentrate on those. Period.</strong> Make it something you can compute, something you can handle with reason.</p>
<div class="embed-"><iframe src="http://embed.ted.com/talks/bruce_schneier.html" width="500" height="281" frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
<p><strong>Well, who would have known that Bruce Schneier is on the same page with me on this.</strong> Tonight I figured that it would be motivational if I watched some TED Talks as I was doing some late night computer work, and <strong>I ended up watching <a title="Schneier TED Talk on Security and models" href="http://on.ted.com/Schneier">Bruce Schneier: The security mirage</a>. Which is pretty interesting in itself, but what got me blogging about it was that he uses the concept of models.</strong> Since the talk is basically about security as a feeling and security as objective reality based on facts, at a certain point he talks about feelings and models. <strong>Feelings are our interpretations based on intuitions, and models are based on reasoning, be it our own, or inherited.</strong> Very interesting stuff. I&#8217;m sure there are people studying psychology etc. to whom this will sound obvious, but to me and to many others, it isn&#8217;t.</p>
<p>Click <a title="Schneier TED Talk transcript" href="http://dotsub.com/view/c722667e-7338-4b17-896b-4714e01129b1/viewTranscript/eng">here for transcript</a>, here for <a title="Schneier on his own TED Talk" href="http://www.schneier.com/blog/archives/2011/04/ted_talk.html">Schneier&#8217;s own blog post</a>, and &#8220;Continue reading&#8221; for some selected quotes and reasoning.<!--more--></p>
<p>&#8220;So let me complicate things. I have feeling and reality. I want to add a third element. I want to add model. Feeling and model in our head, reality is the outside world. It doesn&#8217;t change; it&#8217;s real. So feeling is based on our intuition. Model is based on reason. That&#8217;s basically the difference. In a primitive and simple world, there&#8217;s really no reason for a model. Because feeling is close to reality. You don&#8217;t need a model. But in a modern and complex world, you need models to understand a lot of the risks we face. There&#8217;s no feeling about germs. You need a model to understand them. So this model is an intelligent representation of reality. It&#8217;s, of course, limited by science, by technology. We couldn&#8217;t have a germ theory of disease before we invented the microscope to see them. It&#8217;s limited by our cognitive biases. But it has the ability to override our feelings. &#8220;</p>
<p>Schneier takes this various places, later on. He muses on how it is difficult, and slow, but possible and important to change models. He mentions cognitive dissonance and confirmation bias. He notes that models are especially tricky because not only do we often just inherit them or accept them from others, but models tend to fade into the background and become implicit. <strong>And if we are not aware of our models, how can we be reasonable about them?</strong></p>
<p>&#8220;All examples of models changing. What we learn is that changing models is hard. Models are hard to dislodge. If they equal your feelings, you don&#8217;t even know you have a model.&#8221;</p>
<p>Where does security come in? The way we model reality hugely influences our evaluation of security, both in terms of feeling and in terms of reasoning. There are many mistakes we make, like perceiving the unknown as riskier than the familiar, the personified risks as bigger than the anonymous risks, underestimate risks in situations we control and the opposite in those we don&#8217;t. For example. Schneier sums it up well, if we keep in mind that security is always a trade-off. <strong>&#8220;What&#8217;s important is that they be about the same. it&#8217;s important that, if our feelings match reality, we make better security trade-offs.&#8221;</strong></p>
<p>And, of course, this is not just about security, anyway. It&#8217;s about mapping, as far as I&#8217;m concerned. <strong>I love mapping and models. And I love learning about mapping and models.</strong> So it has been very inspiring to discover these interesting thoughts on the subject, and I figured I might share them with you. Hope it has been useful and interesting. I wish you all a lot of nice, inspiring, productive, reasonable and advantageous mappings.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Sr. Flash/Flex Engineer (Consulting Contract) - Midtown Manhattan, NYC]]></title>
<link>http://itmediajobsnyc.wordpress.com/?p=308</link>
<pubDate>Wed, 27 Apr 2011 15:00:08 +0000</pubDate>
<dc:creator>itmediajobsnyc</dc:creator>
<guid>http://itmediajobsnyc.wordpress.com/?p=308</guid>
<description><![CDATA[Sr. Flash/Flex Engineer LOCATION: Midtown Manhattan, NYC TERMS: Open-Ended Contract for Ongoing Proj]]></description>
<content:encoded><![CDATA[Sr. Flash/Flex Engineer LOCATION: Midtown Manhattan, NYC TERMS: Open-Ended Contract for Ongoing Proj]]></content:encoded>
</item>
<item>
<title><![CDATA[Delving Into Model View Presenter/Controller]]></title>
<link>http://theaveragecoder.wordpress.com/2011/03/15/delving-into-model-view-presentercontroller/</link>
<pubDate>Tue, 15 Mar 2011 23:22:29 +0000</pubDate>
<dc:creator>theaveragecoder</dc:creator>
<guid>http://theaveragecoder.wordpress.com/2011/03/15/delving-into-model-view-presentercontroller/</guid>
<description><![CDATA[There&#8217;s tons of design patterns out there for the developer to get his/her head around. Knowin]]></description>
<content:encoded><![CDATA[<p>There&#8217;s tons of design patterns out there for the developer to get his/her head around. Knowing which ones apply to which scenarios is a mixture of developer experience, business requirements, delivery timescales, and of course self learning. In this post i&#8217;m going to give an introduction to one i&#8217;ve used recently as part of a mobile application, MVP (Model View Presenter). Now for those of you who&#8217;ve heard of MVC (Model View Controller) , this pattern is a variation of the MVC theme, with the goal being separation of concerns between domain model classes, and the User Interface. MVP adds an extra twist of having an interface between the UI (User Interface), and the Presenter Classes (classes which are concerned with setting/reading the properties of the interface  which sits between themselves and the UI, and performing some specific action, for e.g. setting and returning the interface properties to the UI in order for display, or passing the interface properties to a service layer/domain model for performing some business logic operation.</p>
<p>For the project i was working on i chose to leverage a hybrid of MVC and MVP approach, with &#8216;controller&#8217; classes which also contained typical &#8216;presenter&#8217; type functionality.  The controller classes are therefore responsible for sitting between the UI and my domain model controlling the flow between each, and also acting as a presenters by setting/reading properties on the interfaces which sit between them and the UI. This project is quite small, and the domain model is not overly complex so there did not seem the need for an additional service layer between my controller classes and the domain model itself, also, as the code has to run on a mobile device environment (limited amount of CPU and memory), i felt that keeping the code as simple as possible would aid the overall performance when deployed to a mobile device.</p>
<p>It&#8217;s important to understand the main reasons why one may choose an MVC/MVP approach:</p>
<ul>
<li>Separation of UI and domain model concerns &#8211; The UI has no reference to the domain model, and as such, changes can be made in either layer without necessarily requiring code changes in the other  (this is the primary reason for adopting this design pattern)</li>
<li>Amenability to future changes</li>
<li>Testability of UI actions/events without the existence of an actual UI implementation</li>
</ul>
<p>Now, why did i choose to take this approach for this specific project:</p>
<ul>
<li>I wanted to be able to test UI events independently of an actual UI implementation</li>
<li>I envisage multiple different types of client UI making use of this project (NB Not web based UI&#8217;s, for the simple reason, the &#8216;controller/presenter&#8217; classes i&#8217;m dishing up in this example are fine grained i.e. one interface property is set per UI event. A much coarser grained approach would be better suited to a web UI based version)</li>
<li>Lends itself to a Test Driven Development Methodoly (potentially longer to develop, but the pay off is in the reduction of maintenance costs after product relase)</li>
</ul>
<p>Circumstances where i probably would not employ this approach:</p>
<ul>
<li>The business needs the product delivered within a strict/short timescale</li>
<li>There will definitely not be more than one UI making use of the product</li>
<li>There is another technology/pattern which is more suited to developing the product (e.g. ASP.NET MVC for a web based solution with a complex domain model)</li>
</ul>
<p>So to some code examples:</p>
<p>Structure of Code:</p>
<p>For this project i had 4 class libraries:</p>
<p><strong>BusinessLogic</strong> this library contains both the controllers and the domain model definitions</p>
<p><strong>Interfaces</strong> this class library contains the Interface definitions for all the Views, and all the models in my project,  as well as other definitions which are outside the scope of this post. It is important to note that this library has NO dependencies whatsoever. Why? well a library of interfaces is just a bunch of definitions detailing what properties and methods any implementing classes should have.</p>
<p><strong>DataAccess </strong>this class library deals with executing commands against the SQLite database used for the project</p>
<p><strong>MappingLayer </strong>this class library deals with the mapping of datasets returned by the DataAccessLayer into Domain Model objects.</p>
<p>For the purposes of this post we can ignore the DataAccess and Mapping Layers  (i will no doubt post about these in the near future)</p>
<p>I will give examples of a Model Interface, a View Interface, a Controller class, and directions on how the UI would interact with the controller class.</p>
<p>This project deals with people going to visit customers at their home and recording information about the vist which has taken place. The code examples will therefore revolve around the functionality of a &#8216;Visit&#8217; domain model class, a &#8216;controller&#8217; for the &#8216;Visit&#8217; domain model class,  and a View interface for a &#8216;Visit&#8217; View (i.e. a UI component).</p>
<p>First, i usually start with defining the interfaces required in a project, this gives me a solid base for writing the rest of the class libraries involved</p>
<p>*(Note that this approach is purely personal preference. In cases where the requirements are not well understood, it may be more worthwhile to develop some &#8216;throw away&#8217; UI prototypes to expose to the stakeholders for further requirements gathering):</p>
<p>IModelVisit:</p>
<p>&#60;pre&#62;</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using MobileInterfaces.Attributes;</p>
<p>namespace MobileInterfaces.Models<br />
{<br />
[TableName("tblVisit")]<br />
[MappingClass("SimpleMapping.VisitMapper", "SimpleMapping")]<br />
public interface IModelVisit<br />
{</p>
<p>[FieldName("VisitID")]<br />
[FieldType(typeof(string))]<br />
[FieldRequired()]<br />
[PrimaryKey()]<br />
string VisitID { get; set; }</p>
<p>[FieldName("ReferralID")]<br />
[FieldType(typeof(string))]<br />
[FieldRequired()]<br />
string ReferralID { get; set; }</p>
<p>[FieldName("UserID")]<br />
[FieldType(typeof(Guid))]<br />
[FieldRequired()]<br />
string UserID { get; set; }</p>
<p>[FieldName("VisitDate")]<br />
[FieldType(typeof(DateTime))]<br />
[FieldRequired()]<br />
DateTime VisitDate { get; set; }</p>
<p>[FieldName("VisitTime")]<br />
[FieldType(typeof(DateTime))]<br />
[FieldRequired()]<br />
DateTime VisitTime { get; set; }</p>
<p>[FieldName("VisitStatus")]<br />
[FieldType(typeof(Int64))]<br />
[FieldRequired()]<br />
[ForeignKey()]<br />
[ImplementingClass("Models.LookupItem", "MobileLogic")]<br />
IModelLookupItem  VisitStatus { get; set; }</p>
<p>[FieldName("VisitStatusDetails")]<br />
[FieldType(typeof(Int64))]<br />
[ForeignKey()]<br />
[ImplementingClass("Models.LookupItem", "MobileLogic")]<br />
IModelLookupItem VisitStatusDetails { get; set; }</p>
<p>[FieldName("CreatedBy")]<br />
[FieldType(typeof(string))]<br />
string CreatedBy { get; set; }</p>
<p>[FieldName("CreatedDate")]<br />
[FieldType(typeof(DateTime))]<br />
DateTime CreatedDate { get; set; }</p>
<p>[FieldName("UpdatedBy")]<br />
[FieldType(typeof(string))]<br />
string UpdatedBy { get; set; }</p>
<p>[FieldName("UpdatedDate")]<br />
[FieldType(typeof(DateTime?))]<br />
DateTime? UpdatedDate { get; set; }</p>
<p>[FieldName("VisitNotes")]<br />
[FieldType(typeof(string))]<br />
string VisitNotes { get; set; }</p>
<p>[FieldName("IsLTCRelated")]<br />
[FieldType(typeof(Int64?))]<br />
[FieldRequired()]<br />
bool IsLTCRelated { get; set; }</p>
<p>[FieldName("IsMultipleStaffVisit")]<br />
[FieldType(typeof(Int64?))]<br />
[FieldRequired()]<br />
bool IsMultipleStaffVisit { get; set; }</p>
<p>[FieldName("ReasonForMultipleStaff")]<br />
[FieldType(typeof(string))]<br />
string ReasonForMulitpleStaffVisit { get; set; }</p>
<p>[FieldName("VisitContactDataValue")]<br />
[FieldType(typeof(Int64))]<br />
[ForeignKey()]<br />
[ImplementingClass("Models.LookupItem", "MobileLogic")]<br />
IModelLookupItem VisitContactDataValue { get; set; }</p>
<p>[FieldName("ContactLocationDataValue")]<br />
[FieldType(typeof(Int64))]<br />
[ForeignKey()]<br />
[ImplementingClass("Models.LookupItem", "MobileLogic")]<br />
IModelLookupItem ContactLocation { get; set; }</p>
<p>[FieldName("ContactTypeDataValue")]<br />
[FieldType(typeof(Int64))]<br />
[ForeignKey()]<br />
[ImplementingClass("Models.LookupItem", "MobileLogic")]<br />
IModelLookupItem ContactType { get; set; }</p>
<p>[FieldName("OtherLTC")]<br />
[FieldType(typeof(string))]<br />
string OtherLTC { get; set; }</p>
<p>[FieldName("IsAmended")]<br />
[FieldType(typeof(Int64?))]<br />
[FieldRequired()]<br />
bool IsAmended { get; set; }</p>
<p>[FieldName("EpisodeID")]<br />
[FieldType(typeof(string))]<br />
[FieldRequired()]<br />
string EpisodeId { get; set; }</p>
<p>[FieldName("OtherVisitStatusReason")]<br />
[FieldType(typeof(Guid))]<br />
string OtherVisitStatusReason { get; set; }</p>
<p>List&#60;IModelVisitReason&#62; VisitReasons { get; set; }</p>
<p>}//end interface<br />
}//end namespace</p>
<p>&#60;/pre&#62;</p>
<p>and the Interface for the &#8216;Visit&#8217; View: This is the interface which sits between the UI code and the &#8216;controller/presenter&#8217; class.</p>
<p>&#60;pre&#62;</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using MobileInterfaces.Models;</p>
<p>namespace MobileInterfaces.Views<br />
{<br />
public interface IViewVisit<br />
{</p>
<p>List&#60;IModelLookupItem&#62; VisitStatusLookups { get; set; }<br />
List&#60;IModelLookupItem&#62; VisitStatusDetailLookups { get; set; }<br />
List&#60;IModelReasonForVisit&#62; ReasonForVisitLookups { get; set; }<br />
List&#60;IModelLookupItem&#62; ContactLocationLookups { get; set; }<br />
List&#60;IModelLookupItem&#62; ContactTypeLookups { get; set; }<br />
List&#60;IModelLookupItem&#62; VisitContactDataValueLookups { get; set; }</p>
<p>List&#60;IModelStaffMember&#62; StaffMembers { get; set; }</p>
<p>IModelVisit Visit { get; set; }</p>
<p>}//end interface</p>
<p>}//end namespace</p>
<p>&#60;/pre&#62;</p>
<p>Of  course, i have an actual &#8216;Visit&#8217; Model class which lives within the &#8216;Model&#8217; namespace of my BusinessLogic Library. The &#8216;Visit&#8217; domain model class looks like this:</p>
<p>&#60;pre&#62;</p>
<p>using System;<br />
using MobileInterfaces.Models;<br />
using System.Collections.Generic;</p>
<p>namespace Models<br />
{<br />
public class Visit : IModelVisit<br />
{</p>
<p>public string VisitID { get; set; }<br />
public string ReferralID { get; set; }<br />
public string UserID { get; set; }<br />
public DateTime VisitDate { get; set; }<br />
public DateTime VisitTime { get; set; }<br />
public IModelLookupItem VisitStatus { get; set; }<br />
public IModelLookupItem VisitStatusDetails { get; set; }<br />
public string CreatedBy { get; set; }<br />
public DateTime CreatedDate { get; set; }<br />
public string UpdatedBy { get; set; }<br />
public DateTime? UpdatedDate { get; set; }<br />
public string VisitNotes { get; set; }<br />
public bool IsLTCRelated { get; set; }<br />
public bool IsMultipleStaffVisit { get; set; }<br />
public string ReasonForMulitpleStaffVisit { get; set; }<br />
public IModelLookupItem VisitContactDataValue { get; set; }<br />
public IModelLookupItem ContactLocation { get; set; }<br />
public IModelLookupItem ContactType { get; set; }<br />
public string OtherLTC { get; set; }<br />
public bool IsAmended { get; set; }<br />
public string EpisodeId { get; set; }<br />
public string OtherVisitStatusReason { get; set; }</p>
<p>public List&#60;IModelVisitReason&#62; VisitReasons { get; set; }</p>
<p>}//end class<br />
}//end namespace</p>
<p>&#60;/pre&#62;</p>
<p>Now the VisitController class (which lives in the &#8216;Controllers&#8217; namespace of my BusinessLogic library, notice the region sections used to separate out typical Controller actions, and typical Presenter actions:</p>
<p>&#60;pre&#62;</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using MobileInterfaces.Models;<br />
using MobileInterfaces.Views;<br />
using MobileInterfaces.Repositories;<br />
using MobileInterfaces.DataContracts;<br />
using Models;<br />
using Helpers;</p>
<p>namespace CommunityNursingMobile.Controllers<br />
{<br />
public class VisitController<br />
{</p>
<p>IGenericRepository repository;</p>
<p>#region &#8220;constructors&#8221;</p>
<p>public VisitController()<br />
{</p>
<p>//hardcode implementor for just now, use an Ioc container (probably tinyIOC) later<br />
repository = new MobileDataAccess.BaseDAL();</p>
<p>new VisitController(repository);</p>
<p>}//end constructor</p>
<p>public VisitController(IGenericRepository repositoryImplementor)<br />
{<br />
repository = repositoryImplementor;</p>
<p>}//end constructor</p>
<p>#endregion</p>
<p>#region &#8220;Controller Methods&#8221;</p>
<p>/// &#60;summary&#62;<br />
/// gets a visit by visitID<br />
/// &#60;/summary&#62;<br />
/// &#60;param name=&#8221;VisitID&#8221;&#62;&#60;/param&#62;<br />
/// &#60;returns&#62;IModelVisit / Exception is thrown when visit is not found&#60;/returns&#62;<br />
public IModelVisit GetVisitByID(Guid VisitID)<br />
{<br />
IDbOperationResult dbo = repository.GetByID&#60;IModelVisit&#62;(VisitID);</p>
<p>//check the DbOperationResult<br />
if (dbo.ReturnedException != null)<br />
{<br />
throw dbo.ReturnedException;<br />
}</p>
<p>IModelVisit visit = (IModelVisit)(dbo.ReturnedResults);</p>
<p>//ok now get the visit reasons associated with this visit<br />
//using an example VisitReason with the appropriate VisitID property set<br />
IModelVisitReason vr = new VisitReason();<br />
vr.VisitID = visit.VisitID;</p>
<p>//make a list of property names to use when retrieving VisitReasons from data store<br />
List&#60;string&#62; searchProperties = new List&#60;string&#62;();<br />
searchProperties.Add(&#8220;VisitID&#8221;);</p>
<p>VisitReasonController vrc = new VisitReasonController();<br />
visit.VisitReasons = vrc.GetVisitReasonsByExample(vr, searchProperties);</p>
<p>return visit;</p>
<p>}//end method</p>
<p>/// &#60;summary&#62;<br />
/// returns a list of visits with properties which match the properties in the passed in exampleObject<br />
/// &#60;/summary&#62;<br />
/// &#60;param name=&#8221;exampleObject&#8221;&#62;an instantiated IModelVisit&#60;/param&#62;<br />
/// &#60;param name=&#8221;propertyNames&#8221;&#62;the names of the properties which you wish to be used when getting the Visit&#60;/param&#62;<br />
/// &#60;returns&#62;&#60;/returns&#62;<br />
public List&#60;IModelVisit&#62; GetVisitsByExample(object exampleObject, List&#60;string&#62; propertyNames)<br />
{<br />
IDbOperationResult dbo = repository.List&#60;IModelVisit&#62;(exampleObject, propertyNames);</p>
<p>//check the DbOperationResult<br />
if (dbo.ReturnedException != null)<br />
{<br />
throw dbo.ReturnedException;<br />
}</p>
<p>return (List&#60;IModelVisit&#62;)(dbo.ReturnedResults);</p>
<p>}//end method</p>
<p>/// &#60;summary&#62;<br />
/// adds a new visit<br />
/// &#60;/summary&#62;<br />
/// &#60;param name=&#8221;visit&#8221;&#62;&#60;/param&#62;<br />
/// &#60;returns&#62;IModelVisit / Exception is thrown when visit is not persisted successfully&#60;/returns&#62;<br />
public IModelVisit AddNewVisit(IModelVisit Visit)<br />
{</p>
<p>//assign the visit a unique primary key<br />
Visit.VisitID = Guid.NewGuid().ToString();<br />
Visit.CreatedDate = DateTime.Now;</p>
<p>IDbOperationResult dbo = repository.Insert&#60;IModelVisit&#62;(Visit);</p>
<p>//check the DbOperationResult<br />
if (dbo.ReturnedException != null)<br />
{<br />
throw dbo.ReturnedException;<br />
}</p>
<p>if (Visit.VisitReasons != null)<br />
{<br />
for (int i = 0; i &#60; Visit.VisitReasons.Count; i++)<br />
{<br />
VisitReasonController vrc = new VisitReasonController();<br />
Visit.VisitReasons[i].VisitID = Visit.VisitID;<br />
Visit.VisitReasons[i] = vrc.AddNewVisitReason(Visit.VisitReasons[i]);</p>
<p>}//end for<br />
}</p>
<p>return (IModelVisit)(dbo.ReturnedResults);</p>
<p>}//end method</p>
<p>public IModelVisit MakeNewVisit()<br />
{<br />
return new Visit();<br />
}</p>
<p>#endregion</p>
<p>#region &#8220;Presenter Actions&#8221;</p>
<p>public void BindVisitLookups(IViewVisit visitView)<br />
{</p>
<p>//load all lookupGroups<br />
LookupGroupController groupController = new LookupGroupController();<br />
List&#60;IModelLookupGroup&#62; liLookupGroups = groupController.GetAllLookupGroups();</p>
<p>//now load all lookupItems<br />
LookupItemController itemController = new LookupItemController();<br />
List&#60;IModelLookupItem&#62; liLookupItems = itemController.GetAllLookupItems();</p>
<p>//now assign the relevant lookup items to the relevant lookup groups<br />
for (int i = 0; i &#60; liLookupGroups.Count; i++)<br />
{</p>
<p>liLookupGroups[i].LookupItems = new List&#60;IModelLookupItem&#62;();</p>
<p>//loop through items<br />
for (int x = 0; x &#60; liLookupItems.Count; x++)<br />
{<br />
if (liLookupGroups[i].LookupGroupID == liLookupItems[x].LookupGroupID)<br />
{<br />
liLookupGroups[i].LookupItems.Add(liLookupItems[x]);<br />
}</p>
<p>}//end loop through items</p>
<p>}//end loop throgh groups</p>
<p>//now use the sorter class to bind relevant lookup items to the IViewVisit interface implemntation<br />
//passed in as the parmeter to this method<br />
for (int i = 0; i &#60; liLookupGroups.Count; i++)<br />
{<br />
if (liLookupGroups[i].Description == &#8220;CNS_VISIT_CONTACT_TYPE&#8221;)<br />
{<br />
if (visitView.ContactTypeLookups == null)<br />
{<br />
visitView.ContactTypeLookups = new List&#60;IModelLookupItem&#62;();<br />
}//end if</p>
<p>for (int x = 0; x &#60; liLookupGroups[i].LookupItems.Count; x++)<br />
{<br />
visitView.ContactTypeLookups.Add(liLookupGroups[i].LookupItems[x]);<br />
}//end for</p>
<p>}//end if contact type lookups</p>
<p>if (liLookupGroups[i].Description == &#8220;CNS_VISIT_STATUS_REASON&#8221;)<br />
{<br />
if (visitView.VisitStatusDetailLookups  == null)<br />
{<br />
visitView.VisitStatusDetailLookups = new List&#60;IModelLookupItem&#62;();<br />
}//end if</p>
<p>for (int x = 0; x &#60; liLookupGroups[i].LookupItems.Count; x++)<br />
{<br />
visitView.VisitStatusDetailLookups.Add(liLookupGroups[i].LookupItems[x]);<br />
}//end for</p>
<p>}//end if visit status detail lookups</p>
<p>if (liLookupGroups[i].Description == &#8220;CNS_VISIT_STATUS&#8221;)<br />
{<br />
if (visitView.VisitStatusLookups  == null)<br />
{<br />
visitView.VisitStatusLookups = new List&#60;IModelLookupItem&#62;();<br />
}//end if</p>
<p>for (int x = 0; x &#60; liLookupGroups[i].LookupItems.Count; x++)<br />
{<br />
visitView.VisitStatusLookups.Add(liLookupGroups[i].LookupItems[x]);<br />
}//end for</p>
<p>}//end if visit status detail lookups</p>
<p>if (liLookupGroups[i].Description == &#8220;CNS_VISIT_CONTACT_LOCATION&#8221;)<br />
{<br />
if (visitView.ContactLocationLookups == null)<br />
{<br />
visitView.ContactLocationLookups = new List&#60;IModelLookupItem&#62;();<br />
}//end if</p>
<p>for (int x = 0; x &#60; liLookupGroups[i].LookupItems.Count; x++)<br />
{<br />
visitView.ContactLocationLookups.Add(liLookupGroups[i].LookupItems[x]);<br />
}//end for</p>
<p>}//end if contaxct location lookups</p>
<p>if (liLookupGroups[i].Description == &#8220;CNS_VISIT_CONTACT&#8221;)<br />
{<br />
if (visitView.VisitContactDataValueLookups == null)<br />
{<br />
visitView.VisitContactDataValueLookups = new List&#60;IModelLookupItem&#62;();<br />
}//end if</p>
<p>for (int x = 0; x &#60; liLookupGroups[i].LookupItems.Count; x++)<br />
{<br />
visitView.VisitContactDataValueLookups.Add(liLookupGroups[i].LookupItems[x]);<br />
}//end for</p>
<p>}//end if visit contact data value lookups</p>
<p>}//end for</p>
<p>StaffMemberController staffMemberController = new StaffMemberController();<br />
List&#60;IModelStaffMember&#62; liMembers = new List&#60;IModelStaffMember&#62;();<br />
liMembers = staffController.GetAllStaffMembers();<br />
for (int i = 0; i &#60; liMembers.Count; i++)<br />
{<br />
if (visitView.StaffMembers == null)<br />
{<br />
visitView.StaffMembers = new List&#60;IModelStaffMember&#62;();<br />
}</p>
<p>visitView.StaffMembers.Add(liMembers[i]);<br />
}<br />
visitView.StaffMembers = liMembers;</p>
<p>ReasonForVisitController reasonController = new ReasonForVisitController();<br />
List&#60;IModelReasonForVisit&#62; liReasons = new List&#60;IModelReasonForVisit&#62;();<br />
liReasons = reasonController.GetAllReasonForVisits();</p>
<p>for (int i = 0; i &#60; liReasons.Count; i++)<br />
{<br />
if (visitView.ReasonForVisitLookups == null)<br />
{<br />
visitView.ReasonForVisitLookups = new List&#60;IModelReasonForVisit&#62;();<br />
}</p>
<p>visitView.ReasonForVisitLookups.Add(liReasons[i]);<br />
}</p>
<p>}//end method</p>
<p>//methods for setting properties on a domain object model are brought to the controller<br />
//to allow for greater testability, and separation of UI display behaviour from UI interaction with a model</p>
<p>public IModelVisit SetVisitDate(IModelVisit visitObject, DateTime visitDate)<br />
{</p>
<p>//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{</p>
<p>//parse the date<br />
var newDate = DateTime.Parse(visitDate.Year.ToString() + &#8220;-&#8221; + visitDate.Month.ToString() + &#8220;-&#8221; + visitDate.Day.ToString());</p>
<p>visitObject.VisitDate = newDate;<br />
return visitObject;</p>
<p>}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetVisitTime(IModelVisit visitObject, DateTime visitTime)<br />
{<br />
//check the the Visit property is initialized in the received visitObject<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{</p>
<p>visitObject.VisitTime = visitTime;<br />
return visitObject;</p>
<p>}<br />
catch<br />
{<br />
throw;<br />
}<br />
}</p>
<p>public IModelVisit SetReferralID(IModelVisit visitObject, string referralID)<br />
{<br />
//check the the Visit property is initialized in the received visitObject interface<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{<br />
visitObject.ReferralID = referralID;<br />
return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}</p>
<p>public IModelVisit SetVisitID(IModelVisit visitObject, string visitID)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{<br />
visitObject.VisitID = visitID;<br />
return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}</p>
<p>public IModelVisit SetVisitStatus(IModelVisit visitObject, IModelLookupItem visitStatus)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{</p>
<p>//if there is no visit status the make one<br />
if(visitObject.VisitStatus == null)<br />
{<br />
visitObject.VisitStatus = new LookupItem();<br />
}</p>
<p>visitObject.VisitStatus = visitStatus;</p>
<p>//ensure that if visit status is coompleted then there is no VisitStatusReason<br />
if (visitObject.VisitStatus.Description == &#8220;Completed&#8221;)<br />
{<br />
visitObject.VisitStatusDetails = null;<br />
}<br />
else<br />
{<br />
if (visitObject.VisitStatusDetails == null)<br />
{<br />
visitObject.VisitStatusDetails = new LookupItem();<br />
}</p>
<p>}</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetVisitStatusReason(IModelVisit visitObject, IModelLookupItem visitStatusReason)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{</p>
<p>//if there is no visit status the make one<br />
if (visitObject.VisitStatusDetails == null)<br />
{<br />
visitObject.VisitStatusDetails = new LookupItem();<br />
}</p>
<p>visitObject.VisitStatusDetails = visitStatusReason;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>/// &#60;summary&#62;<br />
/// planned or unplanned visit<br />
/// &#60;/summary&#62;<br />
/// &#60;param name=&#8221;visitObject&#8221;&#62;&#60;/param&#62;<br />
/// &#60;param name=&#8221;visitContact&#8221;&#62;&#60;/param&#62;<br />
/// &#60;returns&#62;IModelVisit&#60;/returns&#62;<br />
public IModelVisit SetVisitContactIntention(IModelVisit visitObject, IModelLookupItem visitContact)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{<br />
if (visitObject.VisitContactDataValue == null)<br />
{<br />
visitObject.VisitContactDataValue = new LookupItem();<br />
}</p>
<p>visitObject.VisitContactDataValue = visitContact;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetVisitingStaffMember(IModelVisit visitObject, IModelStaffMember visitMember)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{<br />
visitObject.UserID = visitMember.StaffMemberID;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetVisitNotes(IModelVisit visitObject, string visitNotes)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{<br />
visitObject.VisitNotes = visitNotes;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetLTCRelated(IModelVisit visitObject, bool ltcRelated)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{<br />
visitObject.IsLTCRelated = ltcRelated;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetMultipleStaffVisit(IModelVisit visitObject, bool multipleStaffVisit)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{<br />
visitObject.IsMultipleStaffVisit = multipleStaffVisit;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetReasonForMultipleStaffVisit(IModelVisit visitObject, string reason)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{<br />
visitObject.ReasonForMulitpleStaffVisit = reason;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetContactLocation(IModelVisit visitObject, IModelLookupItem contactLocation)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{</p>
<p>if (visitObject.ContactLocation == null)<br />
{<br />
visitObject.ContactLocation = new LookupItem();<br />
}</p>
<p>visitObject.ContactLocation = contactLocation;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetContactType(IModelVisit visitObject, IModelLookupItem contactType)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{</p>
<p>if (visitObject.ContactType  == null)<br />
{<br />
visitObject.ContactType = new LookupItem();<br />
}</p>
<p>visitObject.ContactType = contactType;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetOtherLTC(IModelVisit visitObject, string otherLTC)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{</p>
<p>visitObject.OtherLTC = otherLTC;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetIsAmended(IModelVisit visitObject, bool amended)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{</p>
<p>visitObject.IsAmended = amended;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SetVisitEpisodeID(IModelVisit visitObject, string episodeID)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{</p>
<p>visitObject.EpisodeId = episodeID;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit SeOtherVisitStatusReason(IModelVisit visitObject, string otherReason)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>try<br />
{<br />
visitObject.OtherVisitStatusReason = otherReason;</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit AddVisitReason(IModelVisit visitObject, int reasonForVisitLookupID)<br />
{</p>
<p>//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>IModelReasonForVisit reasonForVisit = new ReasonForVisit();<br />
reasonForVisit.ReasonID = reasonForVisitLookupID;</p>
<p>try<br />
{<br />
if (visitObject.VisitReasons == null)<br />
{<br />
visitObject.VisitReasons = new List&#60;IModelVisitReason&#62;();<br />
}</p>
<p>var visitReason = new VisitReason();<br />
visitReason.Reason = reasonForVisit;</p>
<p>if (visitObject.VisitID != null)<br />
{<br />
visitReason.VisitID = visitObject.VisitID;<br />
}</p>
<p>visitReason.Interventions = new List&#60;IModelReasonIntervention&#62;();<br />
visitObject.VisitReasons.Add(visitReason);</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>public IModelVisit RemoveVisitReason(IModelVisit visitObject, int reasonForVisitLookupID)<br />
{<br />
//check the the Visit property is initialized in the received view<br />
CheckInitializedVisit(visitObject);</p>
<p>IModelReasonForVisit reasonForVisit = new ReasonForVisit();<br />
reasonForVisit.ReasonID = reasonForVisitLookupID;</p>
<p>try<br />
{</p>
<p>//loop round and find the visit reason and remove it<br />
for (int i = 0; i &#60; visitObject.VisitReasons.Count; i++)<br />
{<br />
if (visitObject.VisitReasons[i].Reason.ReasonID == reasonForVisit.ReasonID)<br />
{<br />
visitObject.VisitReasons.Remove(visitObject.VisitReasons[i]);<br />
break;<br />
}<br />
}</p>
<p>return visitObject;<br />
}<br />
catch<br />
{<br />
throw;<br />
}<br />
}//end method</p>
<p>private void CheckInitializedVisit(IModelVisit visitObject)<br />
{<br />
if (visitObject == null)<br />
{<br />
throw new Exception(&#8220;Attempt to set a property on a visit which was not initilaized was made&#8221;);<br />
}</p>
<p>}</p>
<p>#endregion</p>
<p>}//end class<br />
}//end namespace</p>
<p>&#60;/pre&#62;</p>
<p>Ok, there&#8217;s a lot to the class above but remember, this is so we can test the events which a UI will fire, also this will depend on the amount of properties required in your View interface.</p>
<p>Now putting a UI form in place is pretty simplistic once we have all this in place, we just need to create a UI which implements the &#8216;IViewVisit&#8217; interface, and hook the events of the UI to the Controller defined events for handling UI actions (These are the events in the above Controller class in the region  &#8216;Presenter actions&#8217;)</p>
<p>Also, before you even go as far as creating a UI, you would of course subscribe to a good Test Driven Approach to ensure all the methods of the controller class behave as expected. My advice would be to use a mocking framework to implement the IViewInterface and write tests to emulate the events which would happen on the UI calling the corresponding methods on the Controller class, but that is a whole other topic. By the way, if you haven&#8217;t used a mocking framework before i advise trying one called &#8216;Moq&#8217; to start with. Just google &#8216;Moq&#8217; and you&#8217;ll find it, along with many articles on using it.</p>
<p>OK, that&#8217;s it for just now, feel free to comment or give any suggestions, and/or criticism if you feel it&#8217;s deserved!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[SproutCore: Statecharts vs Controllers ]]></title>
<link>http://frozencanuck.wordpress.com/2011/03/09/sproutcore-statecharts-vs-controllers/</link>
<pubDate>Wed, 09 Mar 2011 08:12:10 +0000</pubDate>
<dc:creator>frozencanuck</dc:creator>
<guid>http://frozencanuck.wordpress.com/2011/03/09/sproutcore-statecharts-vs-controllers/</guid>
<description><![CDATA[As more people start to adopt statecharts to help organize application logic and manage the app]]></description>
<content:encoded><![CDATA[As more people start to adopt statecharts to help organize application logic and manage the app]]></content:encoded>
</item>

</channel>
</rss>
