<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Lexicon of Software</title>
	<atom:link href="http://lexicon-software.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lexicon-software.com</link>
	<description>Devoted to the Art and Science of Software Development</description>
	<lastBuildDate>Mon, 17 Dec 2012 12:49:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Windows 8 &#8211; Developing Windows Store Apps</title>
		<link>http://lexicon-software.com/2012/12/17/windows-8-developing-windows-store-apps/</link>
		<comments>http://lexicon-software.com/2012/12/17/windows-8-developing-windows-store-apps/#comments</comments>
		<pubDate>Mon, 17 Dec 2012 12:49:42 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1549</guid>
		<description><![CDATA[I recently upgraded by desktop to Windows 8. I also started learning about developing Windows 8 style apps. I downloaded a great introductory book called &#8220;Beginning Windows 8 Application Development&#8221; by István Novak, György Balássy, Zoltán Arvai and Dávid Fülöp. I &#8230; <a href="http://lexicon-software.com/2012/12/17/windows-8-developing-windows-store-apps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I recently upgraded by desktop to Windows 8. I also started learning about developing Windows 8 style apps. I downloaded a great introductory book called &#8220;Beginning Windows 8 Application Development&#8221; by István Novak, György Balássy, Zoltán Arvai and Dávid Fülöp.</p>
<p>I also downloaded the <a title="Visual 2012 Express Editions" href="http://www.microsoft.com/visualstudio/eng/downloads#d-2012-express" target="_blank">express versions of Visual Studio 2012</a>. Yes, that&#8217;s right, I said versions (plural). There is an express edition for each different kind of application you can develop. Here is the breakdown;</p>
<ul>
<li>Visual Studio Express 2012 for Web</li>
<li>Visual Studio Express 2012 for Windows 8</li>
<li>Visual Studio Express 2012 for Windows Desktop</li>
<li>Visual Studio Express 2012 for Windows Phone</li>
<li>Visual Studio Express 2012 Team Foundation Server Express 2012</li>
</ul>
<p>If you buy the professional edition of Visual Studio 2012, all of these different types of apps can be developed from a single IDE.</p>
<p>My focus is on developing apps for the Windows Store. This is the type of application development covered in &#8220;Beginning Windows 8 Application Development&#8221;. For this purpose I&#8217;m using Visual Studio Express 2012 for Windows 8. As you would expect, Visual Studio is already loaded up with an adequate set of templates to jump start development. The express edition even comes with a Windows 8 start screen simulator, so you can test things like screen orientation on your desktop.</p>
<p>Microsoft has done a great deal of work to extend Windows 8 style development to a very broad developer community. Windows 8 Style app development supports the following programming languages;</p>
<ul>
<li>C++</li>
<li>C#</li>
<li>Visual Basic</li>
<li>JavaScript</li>
</ul>
<p>User interfaces can be developed with the following languages;</p>
<ul>
<li>HTML5, CSS, and JavaScript</li>
<li>XAML (Extensible Markup Language)</li>
</ul>
<p>XAML based user interfaces can be designed and developed using another free development tool called <a title="Blend for Visual Studio 2012" href="http://msdn.microsoft.com/en-us/library/windows/apps/jj129478.aspx" target="_blank">Blend for Visual Studio 2012 (Windows Store apps)</a>. Blend is fully integrated with Visual Studio 2012. This makes it very easy for the programmer to seamlessly collaborate with the user interface designer.</p>
<p>At this time I have mostly focused on developing some very simple Windows 8 Style applications using JavaScript, HTML5 and CSS.  In support of rapid application development, Microsoft has developed a robust set of pre-written JavaScript functions specifically for development of Windows Store apps.</p>
<p>Here is a helpful link on <a href="http://msdn.microsoft.com/en-us/library/windows/apps/br229519.aspx" title="Learn to build Windows Store apps" target="_blank">learning to build Windows Store apps</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/12/17/windows-8-developing-windows-store-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Surface, Windows RT and Windows 8 &#8211; A Developers Perspective</title>
		<link>http://lexicon-software.com/2012/11/08/microsoft-surface-windows-rt-and-windows-8-a-developers-perspective/</link>
		<comments>http://lexicon-software.com/2012/11/08/microsoft-surface-windows-rt-and-windows-8-a-developers-perspective/#comments</comments>
		<pubDate>Thu, 08 Nov 2012 12:35:06 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Surface]]></category>
		<category><![CDATA[Tablets]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1511</guid>
		<description><![CDATA[This is the first in a series of blog posts about my experiences with the new Microsoft Surface tablet, the Windows RT operating system, and the Windows 8 operating system. On Friday October 26th, the first day they were available, &#8230; <a href="http://lexicon-software.com/2012/11/08/microsoft-surface-windows-rt-and-windows-8-a-developers-perspective/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This is the first in a series of blog posts about my experiences with the new Microsoft Surface tablet, the Windows RT operating system, and the Windows 8 operating system.</p>
<p>On Friday October 26th, the first day they were available, I bought a new Microsoft Surface tablet. Microsoft installed one of their pop-up holiday stores at North Star Mall, here in San Antonio, Texas. The Microsoft store is located in the mall just a few 100 feet from the Apple store. The Microsoft store is cool and modern looking, but it certainly can&#8217;t compare to the style and the on-going buzz of excitement, ones gets at the Apple store. The people working in the Microsoft store were friendly, knowledgeable and very helpful with hands on demonstrations and training. You can also get more information at the online <a title="Microsoft Store" href="http://www.microsoftstore.com/store/msstore/DisplayHomePage" target="_blank">Microsoft Store</a>.</p>
<div id="attachment_1525" class="wp-caption aligncenter" style="width: 2458px"><a href="http://lexicon-software.com/2012/11/08/microsoft-surface-windows-rt-and-windows-8-a-developers-perspective/purchaseofsurface/" rel="attachment wp-att-1525"><img class="size-full wp-image-1525" title="Purchase of the Microsoft Surface tablet" src="http://lexicon-software.com/wp-content/uploads/2012/11/purchaseOfSurface-e1352377106114.jpg" alt="Microsoft Pop up Store" width="2448" height="3264" /></a><p class="wp-caption-text">Purchase of the Microsoft Surface Tablet at North Star Mall</p></div>
<p>It&#8217;s been two weeks now and I&#8217;m really enjoying the Surface tablet. In my opinion, Microsoft brings a right out of the box, fantastic product to the market. Surface meets all expectations, by providing a great mobile tablet experience, in a light weight and very durable package. More importantly, Surface exceeds expectations by taking the tablet to a whole new level of usability, by extending the desktop PC and notebook experience to a mobile device.</p>
<p>The Surface comes with several built in components which also provide a great notebook like experience.</p>
<ul>
<li>Side mounted USB port</li>
<li>Snap on screen cover that doubles as a key board with track pad</li>
<li>High definition video output port</li>
<li>Memory expansion slot that will accommodate an SD card</li>
<li>And Finally, a built in kickstand to prop up the screen at just the right viewing angle</li>
<li>Here is an article at Information Week with more details on the <a title="Microsoft Surface Cool Features" href="http://www.informationweek.com/hardware/handheld/microsoft-surface-tablet-10-coolest-feat/240002490" target="_blank">Cool Features of the Surface</a></li>
</ul>
<p>I&#8217;ve been using the Surface tablet on a daily basis for two weeks now. The user experience is fantastic. Of course, during the first few days there was a small learning curve. This was mostly adapting to the new Windows 8 style start screen, which replaces the Windows start button, which was first introduced in Windows 95. Using the touch screen was no problem at all, because of previous experience with smartphones, iPads and iPods. The one thing that did take some time to get used to, is how every edge of the Surface also has functions. The left edge is used for navigating to all the apps you happen to be using. The right edge has a feature called the charm bar, which has functions for search, computer settings and navigating back to the start screen. The top and bottom edges provide functions based on the context of the app you are currently using. The bottom edge also has a built in button for returning to the start page. Once I learned the edges, I found these features to be very useful. They provide a fast and smooth transition when switching from one task to another.</p>
<p>Clearly, this new user interface is a bold attempt on the part of Microsoft, to reach out to the consumer who simply wants to consume content on a mobile device, and perform some light content creation tasks, such as responding to email, and interacting on social media like Facebook and Twitter. The Windows 8 style user interface will also appeal to the consumer who simply wants to use a computer, and is not interested in learning about file systems or managing the hardware. This is similar to the experience you get with an iPad or a MacBook; you just turn on the device and start using it, intuitively learning as you go.</p>
<p>However, there is another side to the Surface experience, which is very appealing to the traditional Windows desktop user. A user who wants to not only consume content on a mobile device, but also generate content and perform office productivity tasks on the same device. The Surface tablet runs a version of the Windows operating system called Windows RT. This version of the operating system also supports the traditional Windows desktop. The desktop is simply another active tile on the start screen that you tap or click on to start. Once in the desktop, it looks very similar to the desktop in Windows 7. The Surface comes with the Office 2013 suite of productivity apps preinstalled. You get;</p>
<ul>
<li>Word</li>
<li>Excel</li>
<li>Power Point</li>
<li>One Note</li>
<li>All of the other productivity accessories we are used to having available in the desktop</li>
</ul>
<p>In my opinion the Microsoft Surface is the only tablet on the market that lends its self very well to enterprise productivity. Mainly because it does a good job of extending the traditional PC desktop experience to a mobile device. Along with the high resolution screen, the screen cover which also acts as a keyboard, and the built in USB port to support other peripheral devices like a mouse, a memory stick, etc.. In fact I wrote this entire post using the Surface, and my productivity was equal to, if not better, than using a traditional desktop PC.</p>
<p>During this two week experience, I found only one item to complain about, and that is the track pad on the keyboard. I&#8217;m using the type cover, which has mechanical keys that work great and feel natural. However, the track pad is adequate at best. Compared to the smooth and accurate performance of the track pad on the MacBook, this track pad leaves a lot to be desired. However, It was easy to work around this problem. I simply attached a wireless mouse with a USB receiver to the Surface, and kept right on working. Besides, the natural tendency to manipulate the touch screen with finger gestures, kind of makes the track pad redundant.</p>
]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/11/08/microsoft-surface-windows-rt-and-windows-8-a-developers-perspective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2012 and MVC 4</title>
		<link>http://lexicon-software.com/2012/10/15/visual-studio-2012-and-mvc-4/</link>
		<comments>http://lexicon-software.com/2012/10/15/visual-studio-2012-and-mvc-4/#comments</comments>
		<pubDate>Mon, 15 Oct 2012 11:26:34 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1482</guid>
		<description><![CDATA[In my previous post, I laid out a set of objectives for pursuing the ASP.net Web API technology, for developing RESTful web servies. I quickly discovered that the Web API technology is actually a subset of the MVC 4 design &#8230; <a href="http://lexicon-software.com/2012/10/15/visual-studio-2012-and-mvc-4/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In my previous post, I laid out a set of objectives for pursuing the <a title="ASP.Net Web API" href="http://www.asp.net/web-api" target="_blank">ASP.net Web API</a> technology, for developing RESTful web servies. I quickly discovered that the Web API technology is actually a subset of the <a title="ASP.Net MVC 4" href="http://www.asp.net/mvc" target="_blank">MVC 4</a> design pattern, which is available as a project template in Visual Studio 2012.</p>
<p>I decided to take a detour of my objectives and explore the MVC 4 design pattern in more detail. I must say, the detour has taken more time than I anticipated, but it has proven to be well worth the extra time. The MVC 4 template in Visual Studio 2012 automatically generates a fully functional website solution. The template contains all of the required components of the <a title="MVC" href="http://msdn.microsoft.com/en-us/library/ff649643.aspx" target="_blank">Model-View-Controller</a> (MVC) design pattern. The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes:</p>
<ul>
<li>Model. The model 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).</li>
<li>View. The view manages the display of information.</li>
<li>Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.</li>
</ul>
<p>Here is the structural relationship between the three objects.</p>
<div id="attachment_1499" class="wp-caption aligncenter" style="width: 349px"><a href="http://lexicon-software.com/2012/10/15/visual-studio-2012-and-mvc-4/mvc/" rel="attachment wp-att-1499"><img class="size-full wp-image-1499" title="MVC" src="http://lexicon-software.com/wp-content/uploads/2012/10/MVC.jpg" alt="" width="339" height="172" /></a><p class="wp-caption-text">Model-View-Controller design pattern</p></div>
<p>The MVC 4 template in Visual Studio 2012 effectively addresses the architectural concerns covered in this blog throughout the development life cycle of the <a title="World of Art Web App" href="http://lexicon-software-apps.com/Views/Default.aspx" target="_blank">World Of Art Web App</a>;</p>
<ul>
<li>Separation of concerns between database access, user interface and business logic</li>
<li>Incorporates the Entity Framework in a code first process, where the developer can code plain old classes to define the domain in the model, and then generate the database through the entity framework</li>
<li>The controller object automatically adheres to best practices when handling http request and response actions</li>
</ul>
<p>The MVC 4 template automates and streamlines much of the development life cycle, by not only generating code, but also providing a well structured scaffolding approach, which causes architectural and design concerns to fade to the background, allowing the developer to focusing more attention on satisfying the functional requirements of the application.</p>
<p>The ASP.Net Web site has an entire section devoted to the <a href="http://www.asp.net/mvc" title="MVC" target="_blank">MVC 4</a> template. There is a complete set of tutorials to help you become familiar with all the components and features of MVC 4. I will continue following the MVC 4 tutorial all the way through deployment of sample movie application. After completing the tutorials, I plan to develop an MVC 4 version of the World of Art Web app, and report on how this template improves application design and development inefficiencies. </p>
]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/10/15/visual-studio-2012-and-mvc-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2012 and Web API</title>
		<link>http://lexicon-software.com/2012/09/24/visual-studio-2012-and-web-api/</link>
		<comments>http://lexicon-software.com/2012/09/24/visual-studio-2012-and-web-api/#comments</comments>
		<pubDate>Mon, 24 Sep 2012 11:57:53 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1462</guid>
		<description><![CDATA[Visual Studio 2012 recently became available, so I decided to download the Express for Web edition from the Microsoft Products Store. Here is a snapshot of the new look and feel of Visual Studio 2012. See what else is new &#8230; <a href="http://lexicon-software.com/2012/09/24/visual-studio-2012-and-web-api/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Visual Studio 2012 recently became available, so I decided to download the Express for Web edition from the <a href="http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products" title="Microsoft Product Store" target="_blank">Microsoft Products Store</a>.  Here is a snapshot of the new look and feel of Visual Studio 2012. <a href="http://www.microsoft.com/visualstudio/eng/whats-new#story-whats-new" title="What's new in Visual Studio 2012" target="_blank">See what else is new in Visual Studio 2012</a>.<br />
<div id="attachment_1465" class="wp-caption aligncenter" style="width: 1183px"><a href="http://lexicon-software.com/2012/09/24/visual-studio-2012-and-web-api/visual-studio-20012/" rel="attachment wp-att-1465"><img src="http://lexicon-software.com/wp-content/uploads/2012/09/Visual-Studio-20012.jpg" alt="Visual Studio 2012" title="Visual Studio 20012" width="1173" height="886" class="size-full wp-image-1465" /></a><p class="wp-caption-text">Visual Studio 2012 &#8211; New look and Feel</p></div></p>
<p>Within Visual Studio 2012, I have discovered a new technology called <a href="http://www.asp.net/web-api" title="Web API" target="_blank">Web API</a>. According to ASP.net website, ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework. The Web API framework appears to be a subset of the <a href="http://www.asp.net/mvc" title="MVC 4" target="_blank">MVC 4</a> design pattern, which is also included in Visual Studio Express 2012. ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and that gives you full control over markup for enjoyable, agile development. ASP.NET MVC includes many features that enable fast, Test Driven Development (TDD) for creating sophisticated applications that use the latest web standards.</p>
<p>As you know from my most recent articles, I&#8217;ve been focusing on developing web services based on the Microsoft <a href="http://msdn.microsoft.com/en-us/library/bb907578.aspx" title="Window Communication Foundation" target="_blank">Windows Communication Foundation</a> (WCF). You may also recall that the web service I developed is based on the <a href="http://www.ibm.com/developerworks/webservices/library/ws-restful/" title="REST" target="_blank">REST</a> architectural model. Since the Web API technology is also based on REST, I have decided to add this technology to my repertoire. My objectives are the following;</p>
<ul>
<li>Learn Web API from the online tutorials at the ASP.Net website</li>
<li>Develop a prototype web service with Visual Studio 2012</li>
<li>Deploy the web service to the could using Microsoft Azure</li>
<li>Develop a client app for mobile devices like IPad to consume the web service </li>
<li>If all of this works as expected, I will develop a new web service for the World of Art Web App based on Web API</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/09/24/visual-studio-2012-and-web-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evolution of the User Interface</title>
		<link>http://lexicon-software.com/2012/09/10/evolution-of-the-user-interface/</link>
		<comments>http://lexicon-software.com/2012/09/10/evolution-of-the-user-interface/#comments</comments>
		<pubDate>Tue, 11 Sep 2012 03:07:58 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[World Of Art Web App]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1416</guid>
		<description><![CDATA[At this time I have demonstrated three iterations of the Artist web page in The World of Art Web App. The first iteration, simply called the Artist page, was designed with the ASP.Net Web Form model. In this example, I &#8230; <a href="http://lexicon-software.com/2012/09/10/evolution-of-the-user-interface/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>At this time I have demonstrated three iterations of the Artist web page in <a href="http://lexicon-software-apps.com/Views/Default.aspx" title="The World of Art Web App" target="_blank">The World of Art Web App</a>. The first iteration, simply called the <a href="http://lexicon-software-apps.com/Views/ArtistWebForm.aspx" title="The Artists Page" target="_blank">Artist page</a>, was designed with the <a href="http://www.asp.net/web-forms" title="ASP.Net Web Forms" target="_blank">ASP.Net Web Form</a> model. In this example, I developed the user interface with three ASP.Net server side controls;</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/2s019wc0.aspx" title="GridView Web Server Control" target="_blank">GridView</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/s3w1w7t4(v=vs.100)" title="DetailsView Web Server Control" target="_blank">DetailsView</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/k10148y1.aspx" title="SqlDataSource Web Control" target="_blank">SqlDataSource</a></li>
</ul>
<p>The ASP.Net Web Form model depends on the ASP.Net Engine, in the web server, to generate the actual HTML rendered by the client. The input to the ASP.Net engine is the XHTML elements and attributes defined in the .aspx web form file. This model supports a very rapid development process. However, it is a poor architectural design for a distributed web app, because the user interface and database access are tightly coupled. This tight coupling of architectural elements, makes long term maintenance and further development of the app more complicated, because the impact of change has a broad affect across the application. Here is the XHTML source code of the first iteration of the Artist page;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xhtml" style="font-family:monospace;">&lt;%@ Page Title=&quot;World of Art Artist Web Form&quot; Language=&quot;C#&quot; MasterPageFile=&quot;~/Views/SiteMaster.Master&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;ArtistWebForm.aspx.cs&quot; Inherits=&quot;WorldOfArtWebApp.Views.ArtistWebForm&quot; %&gt;
&nbsp;
&lt;asp:Content ID=&quot;Content1&quot; ContentPlaceHolderID=&quot;HeadContent&quot; runat=&quot;server&quot;&gt;
&nbsp;
&lt;/asp:Content&gt;
&lt;asp:Content ID=&quot;Content2&quot; ContentPlaceHolderID=&quot;MainContent&quot; runat=&quot;server&quot;&gt;
    &lt;asp:HyperLink ID=&quot;HyperLinkBlog&quot; runat=&quot;server&quot;  CssClass=&quot;devbloglink&quot;
      NavigateUrl=&quot;http://lexicon-software.com/the-artist-web-form/&quot; Target=&quot;_blank&quot;&gt;Developer&amp;#39;s Blog&lt;/asp:HyperLink&gt;
&nbsp;
    &lt;div  id=&quot;detailsArtist&quot; class=&quot;artistdetaildiv&quot;&gt;
    &lt;asp:DetailsView ID=&quot;DetailsViewArtist&quot; runat=&quot;server&quot; Height=&quot;50px&quot;  CssClass=&quot;artistview&quot;
          Width=&quot;347px&quot; AutoGenerateRows=&quot;False&quot; DataSourceID=&quot;SqlDataSourceArtist&quot; 
          AlternatingRowStyle-CssClass=&quot;altrowstyle&quot; PagerStyle-CssClass=&quot;footerstyle&quot; 
          CellPadding=&quot;4&quot; RowStyle-CssClass=&quot;rowstyleartistviews&quot;
         PagerStyle-ForeColor=&quot;#f9f9f9&quot; AllowPaging=&quot;True&quot;&gt;
          &lt;AlternatingRowStyle CssClass=&quot;altrowstyle&quot;&gt;&lt;/AlternatingRowStyle&gt;
        &lt;Fields&gt;
            &lt;asp:BoundField DataField=&quot;FirstName&quot; HeaderText=&quot;First Name&quot; SortExpression=&quot;Name&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;LastName&quot; HeaderText=&quot;Last Name&quot; SortExpression=&quot;Name&quot; /&gt;
&nbsp;
           &lt;asp:BoundField DataField=&quot;BirthDay&quot; HeaderText=&quot;Birthday&quot; 
                SortExpression=&quot;BirthDay&quot; DataFormatString=&quot;{0:d}&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;City&quot; HeaderText=&quot;City&quot; SortExpression=&quot;City&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;Country&quot; HeaderText=&quot;Country&quot; 
                SortExpression=&quot;Country&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;TypeOfArtist&quot; HeaderText=&quot;Type Of Artist&quot; 
                SortExpression=&quot;TypeOfArtist&quot; /&gt;
        &lt;/Fields&gt;
         &lt;PagerStyle CssClass=&quot;footerstyle&quot; ForeColor=&quot;#F9F9F9&quot;&gt;&lt;/PagerStyle&gt;
         &lt;RowStyle CssClass=&quot;rowstyleartistviews&quot;&gt;&lt;/RowStyle&gt;
    &lt;/asp:DetailsView&gt;
   &lt;/div&gt;
&nbsp;
   &lt;div id=&quot;gridArtist&quot; class=&quot;artistgriddiv&quot;&gt;
    &lt;asp:GridView ID=&quot;GridViewArtist&quot; runat=&quot;server&quot; AllowPaging=&quot;True&quot;  
           CssClass=&quot;artistview&quot; AlternatingRowStyle-CssClass=&quot;altrowstyle&quot; CellPadding=&quot;4&quot;
           RowStyle-CssClass=&quot;rowstyleartistviews&quot; HeaderStyle-CssClass=&quot;headerstyle&quot; 
           HeaderStyle-ForeColor=&quot;#f9f9f9&quot;  AllowSorting=&quot;True&quot; 
           DataSourceID=&quot;SqlDataSourceArtist&quot; AutoGenerateColumns=&quot;False&quot;&gt;
        &lt;AlternatingRowStyle CssClass=&quot;altrowstyle&quot;&gt;&lt;/AlternatingRowStyle&gt;
&nbsp;
        &lt;Columns&gt;
            &lt;asp:BoundField DataField=&quot;FirstName&quot; HeaderText=&quot;First Name&quot; 
                SortExpression=&quot;FirstName&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;LastName&quot; HeaderText=&quot;Last Name&quot; 
                SortExpression=&quot;LastName&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;BirthDay&quot; DataFormatString=&quot;{0:d}&quot; 
                HeaderText=&quot;Date of Birth&quot; SortExpression=&quot;BirthDay&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;City&quot; HeaderText=&quot;City&quot; SortExpression=&quot;City&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;Country&quot; HeaderText=&quot;Country&quot; 
                SortExpression=&quot;Country&quot; /&gt;
        &lt;/Columns&gt;
&nbsp;
        &lt;HeaderStyle CssClass=&quot;headerstyle&quot; ForeColor=&quot;AntiqueWhite&quot;&gt;&lt;/HeaderStyle&gt;
&nbsp;
        &lt;RowStyle CssClass=&quot;rowstyleartistviews&quot;&gt;&lt;/RowStyle&gt;
    &lt;/asp:GridView&gt;
 &lt;/div&gt;
&nbsp;
&lt;asp:SqlDataSource ID=&quot;SqlDataSourceArtist&quot; runat=&quot;server&quot; 
    ConnectionString=&quot;&lt;%$ ConnectionStrings:DB_38836_aspnetdbConnectionString %&gt;&quot; 
    SelectCommand=&quot;SELECT FirstName, LastName, BirthDay, City, Country, TypeOfArtist FROM aspnet_Artist&quot;&gt;
&lt;/asp:SqlDataSource&gt;
&nbsp;
&lt;/asp:Content&gt;</pre></td></tr></table></div>

<p>In the second iteration of the Artist page, which I called <a href="http://lexicon-software-apps.com/Views/ArtistEntityWebForm.aspx" title="Art Entities " target="_blank">Art Entities</a>, I eliminated the SqlDataSource web server control, and created a separation of concerns between the user interface and data access. This is where I introduced the concept of a layered architectural design, with the development of the <a href="http://lexicon-software.com/2012/04/11/separation-of-concerns-data-access-layer/" title="Separation of Concerns – Data Access Layer" target="_blank">Data Access Layer</a>, and the <a href="http://lexicon-software.com/2012/04/09/the-data-model-layer/" title="The Data Model Layer" target="_blank">Data Model Layer</a>. In the Data Model Layer, I developed an Entity Relationship Model with the <a href="http://msdn.microsoft.com/en-us/library/aa697427(v=vs.80).aspx" title="ADO.NET Entity Framework" target="_blank">ADO.Net Entity Framework</a>, which created a line of clear separation, and decoupling, between data access functions and the SQL Server database. </p>
<p>In this phase of development, the user interface evolved into an external layer of the overall web app design. However, the user interface is still based on server side ASP.Net web server controls. I simply exploited the data binding methods, built into these controls, to create an API to the data access layer. Here is the XHTML and C# source code used to render the <a href="http://lexicon-software-apps.com/Views/ArtistEntityWebForm.aspx" title="Art Entities " target="_blank">Art Entities</a> page of the World of Art Web App;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xhtml" style="font-family:monospace;">&lt;%@ Page Title=&quot;&quot; Language=&quot;C#&quot; MasterPageFile=&quot;~/Views/SiteMaster.Master&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;ArtistEntityWebForm.aspx.cs&quot; Inherits=&quot;WorldOfArtWebApp.Views.ArtistEntityWebForm&quot; %&gt;
&lt;asp:Content ID=&quot;Content1&quot; ContentPlaceHolderID=&quot;HeadContent&quot; runat=&quot;server&quot;&gt;
&lt;/asp:Content&gt;
&lt;asp:Content ID=&quot;Content2&quot; ContentPlaceHolderID=&quot;MainContent&quot; runat=&quot;server&quot;&gt;
&lt;div id=&quot;gridArtist&quot; class=&quot;artistgriddiv&quot;&gt;
    &lt;asp:GridView ID=&quot;GridViewArtist&quot; runat=&quot;server&quot; AllowPaging=&quot;True&quot;  
           CssClass=&quot;artistview&quot; AlternatingRowStyle-CssClass=&quot;altrowstyle&quot; CellPadding=&quot;4&quot;
         RowStyle-CssClass=&quot;rowstyleartistviews&quot; HeaderStyle-CssClass=&quot;headerstyle&quot; 
           HeaderStyle-ForeColor=&quot;#f9f9f9&quot;  AllowSorting=&quot;True&quot; AutoGenerateColumns=&quot;False&quot;&gt;
        &lt;AlternatingRowStyle CssClass=&quot;altrowstyle&quot;&gt;&lt;/AlternatingRowStyle&gt;
&nbsp;
        &lt;Columns&gt;
            &lt;asp:BoundField DataField=&quot;Name&quot; HeaderText=&quot;Artist Name&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;DateOfBirth&quot; DataFormatString=&quot;{0:d}&quot; HeaderText=&quot;Date of Birth&quot; /&gt;
            &lt;asp:BoundField DataField=&quot;PlaceOfBirth&quot; HeaderText=&quot;Place Of Birth&quot; /&gt;
&nbsp;
        &lt;/Columns&gt;
&nbsp;
      &lt;HeaderStyle CssClass=&quot;headerstyle&quot; ForeColor=&quot;AntiqueWhite&quot;&gt;&lt;/HeaderStyle&gt;
      &lt;RowStyle CssClass=&quot;rowstyleartistviews&quot;&gt;&lt;/RowStyle&gt;
    &lt;/asp:GridView&gt;
&lt;/div&gt;
&lt;div id=&quot;gridWorkOfArt&quot; class=&quot;artistgriddiv&quot;&gt;
   &lt;asp:GridView ID=&quot;GridViewWorkOfArt&quot; runat=&quot;server&quot; AllowPaging=&quot;true&quot;
    CssClass=&quot;artistview&quot; AlternatingRowStyle-CssClass=&quot;altrowstyle&quot; CellPadding=&quot;4&quot;
         RowStyle-CssClass=&quot;rowstyleartistviews&quot; HeaderStyle-CssClass=&quot;headerstyle&quot; 
           HeaderStyle-ForeColor=&quot;#f9f9f9&quot;  AllowSorting=&quot;True&quot; AutoGenerateColumns=&quot;False&quot;&gt;
        &lt;AlternatingRowStyle CssClass=&quot;altrowstyle&quot;&gt;&lt;/AlternatingRowStyle&gt;
&nbsp;
        &lt;Columns&gt;
           &lt;asp:BoundField DataField=&quot;Title&quot; HeaderText=&quot;Title&quot; /&gt;
           &lt;asp:BoundField DataField=&quot;ArtistName&quot; HeaderText=&quot;Artist&quot; /&gt;
&nbsp;
        &lt;/Columns&gt;
&nbsp;
        &lt;HeaderStyle CssClass=&quot;headerstyle&quot; ForeColor=&quot;AntiqueWhite&quot;&gt;&lt;/HeaderStyle&gt;
        &lt;RowStyle CssClass=&quot;rowstyleartistviews&quot;&gt;&lt;/RowStyle&gt;
   &lt;/asp:GridView&gt;
&lt;/div&gt;
&nbsp;
&nbsp;
   &lt;div&gt;
   &lt;asp:Label runat=&quot;server&quot; ID=&quot;labelException&quot;&gt;&lt;/asp:Label&gt;
   &lt;/div&gt;
&lt;/asp:Content&gt;</pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI.WebControls</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">ArtWorldObjects</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">WorldOfArtWebApp.DataAccess</span><span style="color: #008000;">;</span>
&nbsp;
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> WorldOfArtWebApp<span style="color: #008000;">.</span><span style="color: #0000FF;">Views</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> ArtistEntityWebForm <span style="color: #008000;">:</span> <span style="color: #000000;">System.<span style="color: #0000FF;">Web</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UI</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Page</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> ArtWorldCollectionArtist artistData<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> ArtWorldCollectionArtPiece workOfArtData<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> TitleArtist titleArtist<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> List<span style="color: #008000;">&lt;</span>TitleArtist<span style="color: #008000;">&gt;</span> titleArtistList<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> Page_Load<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            LoadArtistView<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            LoadWorkOfArtView<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> LoadArtistView<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">try</span>
            <span style="color: #008000;">&#123;</span>
                artistData <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ArtWorldCollectionArtist<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>artistData<span style="color: #008000;">.</span><span style="color: #0000FF;">ArtWorldCollection</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span> <span style="color: #008000;">&amp;&amp;</span> artistData<span style="color: #008000;">.</span><span style="color: #0000FF;">ExceptionMessage</span> <span style="color: #008000;">==</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GridViewArtist</span><span style="color: #008000;">.</span><span style="color: #0000FF;">DataSource</span> <span style="color: #008000;">=</span> artistData<span style="color: #008000;">.</span><span style="color: #0000FF;">GetListOfArtist</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GridViewArtist</span><span style="color: #008000;">.</span><span style="color: #0000FF;">DataBind</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
                <span style="color: #0600FF; font-weight: bold;">else</span>
                <span style="color: #008000;">&#123;</span>
                    <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">labelException</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;The artist information you requested is not available. &quot;</span> <span style="color: #008000;">+</span> artistData<span style="color: #008000;">.</span><span style="color: #0000FF;">ExceptionMessage</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception ex<span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">labelException</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;The artist information you requested is not available. &quot;</span> <span style="color: #008000;">+</span> ex<span style="color: #008000;">.</span><span style="color: #0000FF;">Message</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> LoadWorkOfArtView<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">try</span>
            <span style="color: #008000;">&#123;</span>
                workOfArtData <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ArtWorldCollectionArtPiece<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>workOfArtData<span style="color: #008000;">.</span><span style="color: #0000FF;">ArtWorldCollection</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span> <span style="color: #008000;">&amp;&amp;</span> workOfArtData<span style="color: #008000;">.</span><span style="color: #0000FF;">ExceptionMessage</span> <span style="color: #008000;">==</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    titleArtistList <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span>TitleArtist<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">var</span> workOfArtInList <span style="color: #0600FF; font-weight: bold;">in</span> workOfArtData<span style="color: #008000;">.</span><span style="color: #0000FF;">GetListOfArtPiece</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                    <span style="color: #008000;">&#123;</span>
                        titleArtist <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> TitleArtist<span style="color: #008000;">&#40;</span>workOfArtInList<span style="color: #008000;">.</span><span style="color: #0000FF;">TheArtist</span>, workOfArtInList<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                        titleArtistList<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Add</span><span style="color: #008000;">&#40;</span>titleArtist<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #008000;">&#125;</span>
                    <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GridViewWorkOfArt</span><span style="color: #008000;">.</span><span style="color: #0000FF;">DataSource</span> <span style="color: #008000;">=</span> titleArtistList<span style="color: #008000;">;</span>
                    <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GridViewWorkOfArt</span><span style="color: #008000;">.</span><span style="color: #0000FF;">DataBind</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
                <span style="color: #0600FF; font-weight: bold;">else</span>
                <span style="color: #008000;">&#123;</span>
                    <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">labelException</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;The art information you requested is not available. &quot;</span> <span style="color: #008000;">+</span> workOfArtData<span style="color: #008000;">.</span><span style="color: #0000FF;">ExceptionMessage</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception ex<span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">labelException</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;The art information you requested is not available. &quot;</span> <span style="color: #008000;">+</span> ex<span style="color: #008000;">.</span><span style="color: #0000FF;">Message</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// Helper class for binding data to the Work of art gridview </span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> TitleArtist
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">string</span> m_artistName<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">string</span> m_title<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> TitleArtist<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> TitleArtist<span style="color: #008000;">&#40;</span>Artist artist, ArtPiece workOfArt<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            m_artistName <span style="color: #008000;">=</span> artist<span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span><span style="color: #008000;">;</span>
            m_title <span style="color: #008000;">=</span> workOfArt<span style="color: #008000;">.</span><span style="color: #0000FF;">Title</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> ArtistName
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> m_artistName<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Title
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> m_title<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>The ASP.Net Web server controls, used in the first two iterations of the user interface, is a suitable design solution for an enterprise level application, which is running internally to the enterprise. The number of users is limited to the employee and associates base, the application is supported by the internal IT infrastructure of the enterprise as an <a href="http://www.alphafiveintranet.com/intranet-application.html" title="Intranet Application" target="_blank">intranet appliation</a>. The view state and post back model, supported by these web server controls, performs very well in this environment. However, if the application is to be distributed over a wide range of clients, and accessible from the world wide web, a much leaner and flexible architectural model is required. This is a requirement for the World of Art Web App. Therefore, in this latest iteration of the app, I added a web service layer to the architecture, based on the Microsoft <a href="http://lexicon-software.com/2012/08/13/web-service-based-on-wcf-and-rest/" title="Web Service based on WCF and REST" target="_blank">Windows Communication Foundation</a> (WCF). Accessing the service layer of the World of Art Web app, was a driving factor behind the design of the third iteration of the user interface. </p>
<p>Accessing the service layer, reverses the flow of content between the client and the server. In the previous versions, where server side controls were used, content was pushed from the server to the client. However, acquiring content from the service layer, requires the client to pull content from the server through an HTTP request.     </p>
<p>The third iteration of the artists page, which I called <a href="http://lexicon-software-apps.com/Views/ArtistEntityAjax.aspx" title="Art Entities from Web Service" target="_blank">Art Entities from Service</a>, is a very minimal and efficient design, utilizing an HTTP GET Request to retrieve artist data from the web service, and JavaScript to render the artist result set in HTML. I also employed a <a href="http://www.w3schools.com/css3/css3_intro.asp" title="CSS 3 - Cascading Style Sheets - 3" target="_blank">CSS 3</a> cascading style sheet to complete the look and feel of the page.</p>
<p>Here is the XHTML source code of the ASP.net web form and the JavaScript source code used in the third iteration of the user interface;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xhtml" style="font-family:monospace;">&lt;%@ Page Title=&quot;&quot; Language=&quot;C#&quot; MasterPageFile=&quot;~/Views/SiteMaster.Master&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;ArtistEntityAjax.aspx.cs&quot; Inherits=&quot;WorldOfArtWebApp.Views.ArtistEntityAjax&quot; %&gt;
&lt;asp:Content ID=&quot;Content1&quot; ContentPlaceHolderID=&quot;HeadContent&quot; runat=&quot;server&quot;&gt;
&lt;/asp:Content&gt;
&lt;asp:Content ID=&quot;Content2&quot; ContentPlaceHolderID=&quot;MainContent&quot; runat=&quot;server&quot;&gt;
&lt;link href=&quot;Styles/Art.css&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;h2&gt;
    List of Artists From World of Art Web Service
&lt;/h2&gt;
&lt;p&gt;
&nbsp;
&lt;/p&gt;
&lt;div id=&quot;arts&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;../Scripts/GetArtists.js&quot;&gt;&lt;/script&gt;
&nbsp;
&lt;/asp:Content&gt;</pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/*
* get the artist content of a JSON file using Ajax 
*
*/</span>
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    getArtistsAjax<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">function</span> getArtistsAjax<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    jQuery.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        type<span style="color: #339933;">:</span> <span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span>
        url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://lexicon-software-apps.com/ArtService.svc/GetArtists'</span><span style="color: #339933;">,</span>
        dataType<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;jsonp&quot;</span><span style="color: #339933;">,</span>
        success<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            updateArtists<span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        error<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            requestFailed<span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">function</span> updateArtists<span style="color: #009900;">&#40;</span>artists<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>artists.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">||</span> artists <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        requestFailed<span style="color: #009900;">&#40;</span>artists<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">var</span> artistDiv <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;arts&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> artists.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">var</span> artist <span style="color: #339933;">=</span> artists<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            div.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;class&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;artItem&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            div.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> artist.<span style="color: #660066;">Name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; was born in &quot;</span> <span style="color: #339933;">+</span> artist.<span style="color: #660066;">PlaceOfBirth</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; on &quot;</span> <span style="color: #339933;">+</span> artist.<span style="color: #660066;">DateOfBirthLongString</span><span style="color: #339933;">;</span>
            artistDiv.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>div<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">function</span> requestFailed<span style="color: #009900;">&#40;</span>results<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    alert<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;The artist information you requested is not available&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Here is the cascading style sheet. You will notice some of the new CSS 3 attributes like &#8220;border-radius&#8221;, which is used to form the rounded corners of the artist grid in the <a href="http://lexicon-software-apps.com/Views/ArtistEntityAjax.aspx" title="Artist Entities from Web Service" target="_blank">Entities From Service</a> page.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* artists.css */</span>
&nbsp;
body <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #cc00cc;">#arts</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#d9d9d9</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-radius</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#d9d9d9</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.artItem</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Verdana<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#434343</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.artItem</span><span style="color: #3333ff;">:nth-</span>child<span style="color: #00AA00;">&#40;</span>2n<span style="color: #00AA00;">&#41;</span>
<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fafafa</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.artItem</span><span style="color: #3333ff;">:first-child </span><span style="color: #00AA00;">&#123;</span>
	-webkit-border-top-left-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
	-webkit-border-top-right-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-top-left-radius</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-top-right-radius</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
div<span style="color: #6666ff;">.artItem</span><span style="color: #3333ff;">:last-child </span><span style="color: #00AA00;">&#123;</span>
	-webkit-border-bottom-left-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
	-webkit-border-bottom-right-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom-left-radius</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom-right-radius</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/09/10/evolution-of-the-user-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The AJAX Client and Cross-Domain GET Requests</title>
		<link>http://lexicon-software.com/2012/09/03/the-ajax-client-and-cross-domain-get-requests/</link>
		<comments>http://lexicon-software.com/2012/09/03/the-ajax-client-and-cross-domain-get-requests/#comments</comments>
		<pubDate>Mon, 03 Sep 2012 18:07:45 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1364</guid>
		<description><![CDATA[In developing the client to consume the World of Art Web Service, I decided to stick with the ASP.Net Web Form (.aspx). This allowed me to take advantage of the master page concept already implemented in the World of Art &#8230; <a href="http://lexicon-software.com/2012/09/03/the-ajax-client-and-cross-domain-get-requests/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In developing the client to consume the World of Art Web Service, I decided to stick with the ASP.Net Web Form (.aspx). This allowed me to take advantage of the master page concept already implemented in the <a href="http://lexicon-software-apps.com/Views/ArtistEntityAjax.aspx" title="World Of Art Web App - Ajax Client" target="_blank">World of Art Web App</a>.  Following is the markup source code of the .ASPX page. As you can see it has some very basic ingredients;</p>
<ul>
<li>Page declaration with a reference to the web site master page</li>
<li>HTML Heading Tag</li>
<li>A script tag pointing to a JavaScript source code file called GetArtists.js</li>
</ul>
<p>Here is the XHTML mark up code of the .aspx web form;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xhtml" style="font-family:monospace;">&lt;%@ Page Title=&quot;&quot; Language=&quot;C#&quot; MasterPageFile=&quot;~/Views/SiteMaster.Master&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;ArtistEntityAjax.aspx.cs&quot; Inherits=&quot;WorldOfArtWebApp.Views.ArtistEntityAjax&quot; %&gt;
&lt;asp:Content ID=&quot;Content1&quot; ContentPlaceHolderID=&quot;HeadContent&quot; runat=&quot;server&quot;&gt;
&lt;/asp:Content&gt;
&lt;asp:Content ID=&quot;Content2&quot; ContentPlaceHolderID=&quot;MainContent&quot; runat=&quot;server&quot;&gt;
&lt;link href=&quot;Styles/Art.css&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;h2&gt;
    List of Artists From World of Art Web Service
&lt;/h2&gt;
&lt;p&gt;
&nbsp;
&lt;/p&gt;
&lt;div id=&quot;arts&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;../Scripts/GetArtists.js&quot;&gt;&lt;/script&gt;
&nbsp;
&lt;/asp:Content&gt;</pre></td></tr></table></div>

<p>The heart of the client application is the JavaScript in the GetArtists.js file. There are two primary functions;</p>
<ul>
<li><strong>getArtistsAjax()</strong> &#8211; Requests artist data from the World Of Art Web Service</li>
<li><strong>updateArtists()</strong> &#8211; Dynamically generates the user interface </li>
</ul>
<p>Here is the JavaScript source code of the client.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/*
* get the artist content of a JSON file using Ajax 
*
*/</span>
&nbsp;
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    getArtistsAjax<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000066; font-weight: bold;">function</span> getArtistsAjax<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    jQuery.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        type<span style="color: #339933;">:</span> <span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span>
        url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://lexicon-software-apps.com/ArtService.svc/GetArtists'</span><span style="color: #339933;">,</span>
        dataType<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;jsonp&quot;</span><span style="color: #339933;">,</span>
        success<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            updateArtists<span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        error<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            requestFailed<span style="color: #009900;">&#40;</span>result<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000066; font-weight: bold;">function</span> updateArtists<span style="color: #009900;">&#40;</span>artists<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>artists.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">||</span> artists <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        requestFailed<span style="color: #009900;">&#40;</span>artists<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">var</span> artistDiv <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;arts&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> artists.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">var</span> artist <span style="color: #339933;">=</span> artists<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            div.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;class&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;artItem&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            div.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> artist.<span style="color: #660066;">Name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; was born in &quot;</span> <span style="color: #339933;">+</span> artist.<span style="color: #660066;">PlaceOfBirth</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; on &quot;</span> <span style="color: #339933;">+</span> artist.<span style="color: #660066;">DateOfBirthLongString</span><span style="color: #339933;">;</span>
            artistDiv.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>div<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">function</span> requestFailed<span style="color: #009900;">&#40;</span>results<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    alert<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;The artist information you requested is not available&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Lets first examine the getArtistsAjax() function. There are many different ways to perform an HTTP GET request. After trying a number of different combinations, I found this implementation to be a straightforward and flexible solution. The getArtistsAjax() function uses the <a href="http://api.jquery.com/jQuery.ajax/" title="jQuery.ajax() Method" target="_blank">JQuery.ajax()</a> method, to perform the asynchronous HTTP(Ajax) request for artist data from the ArtService. The jQuery.ajax() method can be configured with a multitude of settings and parameters. However, for the simple HTTP GET request required by this application, I found it necessary to only pass five arguments to the jQuery.ajax() method, which are coded as key/value pairs;</p>
<ul>
<li><strong>type:</strong> &#8220;GET&#8221; &#8211; The type of request to make (&#8220;POST&#8221; or &#8220;GET&#8221;)</li>
<li><strong>url:</strong> &#8216;http://lexicon-software-apps.com/ArtService.svc/GetArtists&#8217; &#8211; A string containing the URL to which the request is sent.</li>
<li><strong>dataType:</strong> &#8220;jsonp&#8221; &#8211; Loads in a JSON block using <a href="http://bob.ippoli.to/archives/2005/12/05/remote-json-jsonp/" title="JSONP" target="_blank">JSONP</a>. Adds an extra &#8220;?callback=?&#8221; to the end of your URL to specify the callback. Disables caching by appending a query string parameter, &#8220;_=[TIMESTAMP]&#8220;, to the URL unless the cache option is set to true.</li>
<li><strong>success:</strong> function() &#8211; A function to be called if the request succeeds.</li>
<li><strong>error:</strong> function() &#8211; A function to be called if the request fails.</li>
</ul>
<p>The most interesting setting is the dataType set to &#8220;jsonP&#8221;. This gives the client flexibility to perform a &#8220;GET&#8221; request from a domain other than the one that served the original page request. The following illustrates an example of this. I setup an alternate domain at Winhost called Lexicon-Software-Learning.com. I published the World of Art Web Service at Lexicon-Software-Learning.com. I then changed the url setting to point to the learning domain. Here is the result;</p>
<div id="attachment_1387" class="wp-caption aligncenter" style="width: 738px"><a href="http://lexicon-software.com/2012/09/03/the-ajax-client-and-cross-domain-get-requests/crossdomainexample/" rel="attachment wp-att-1387"><img src="http://lexicon-software.com/wp-content/uploads/2012/09/CrossDomainExample.jpg" alt="Cross Domain Get Request" title="Cross Domain HTTP GET Request Example" width="728" height="732" class="size-full wp-image-1387" /></a><p class="wp-caption-text">The artists entity web page is served from Lexicon-Software-Apps.com domain and the get artists data request is served from Lexicon-Software-Learning.com.</p></div>
<p>The other primary JavaScript function in GetArtists.js is the updateArtists() function. It receives the JSON formatted data result set from the HTTP GET request. The JSON data is basically an array of artist objects. This function simply iterates through the array of artist objects, and adds them as elements to the web pages&#8217; <a href="http://www.w3.org/TR/DOM-Level-2-Core/introduction.html" title="Document Object Model (DOM)" target="_blank">Document Object Model (DOM)</a> object. I also applied some new CSS 3 style sheet elements, to finish off the look and feel, of the list of artists page.  </p>
<p>I will cover the user interface in more detail in my next post. We will also look at the evolution of the user interface in the World of Art Web App, from the first iteration which was server side generated, to this latest iteration which is client side generated.</p>
<p>Here is the CSS 3 Cascading Style Sheet</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xhtml" style="font-family:monospace;">/* artists.css */
&nbsp;
body {
	margin-left: 40px;
	margin-right: 40px;
}
div#arts {
	background-color: #d9d9d9;
	-webkit-border-radius: 6px;
	border-radius: 6px;
	margin: 10px 0px 0px 0px;
	padding: 0px;
	border: 1px solid #d9d9d9;
}
div.artItem {
	font-family: Verdana, Helvetica, sans-serif;
	color: #434343;
	padding: 10px;
}
div.artItem:nth-child(2n)
{
    background-color: #fafafa;
}
div.artItem:first-child {
	-webkit-border-top-left-radius: 6px;
	-webkit-border-top-right-radius: 6px;
	border-top-left-radius: 6px;
	border-top-right-radius: 6px;
}
div.artItem:last-child {
	-webkit-border-bottom-left-radius: 6px;
	-webkit-border-bottom-right-radius: 6px;
	border-bottom-left-radius: 6px;
	border-bottom-right-radius: 6px;
}</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/09/03/the-ajax-client-and-cross-domain-get-requests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deployment of the WCF Web Service</title>
		<link>http://lexicon-software.com/2012/08/29/deployment-of-the-wcf-web-service/</link>
		<comments>http://lexicon-software.com/2012/08/29/deployment-of-the-wcf-web-service/#comments</comments>
		<pubDate>Wed, 29 Aug 2012 12:15:39 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1332</guid>
		<description><![CDATA[Deployment of the World Of Art Web Service app was a very simple one step process. From the Build Menu in Visual Studio 2010, select the Publish WorldOfArtServiceApp option. This will launch the Publish Web dialogue box. As you can &#8230; <a href="http://lexicon-software.com/2012/08/29/deployment-of-the-wcf-web-service/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Deployment of the World Of Art Web Service app was a very simple one step process. </p>
<p>From the Build Menu in Visual Studio 2010, select the Publish WorldOfArtServiceApp option. This will launch the  Publish Web dialogue box. </p>
<p>As you can see from the illustration below, my hosting provider, WinHost, supports the one click publishing feature in Visual Studio 2010.  I&#8217;m using the same server URL and domain name as the World of Art Web App.  Notice the check box to indicate this is an IIS application on destination.  </p>
<p>By structuring the WCF web service as a separate project I have the flexibility to publish to other domain names I have hosted at WinHost. <strong>The only disadvantage to this approach, is that anytime the World of Art Web App is re-published with new development, the World of Art Web Service also must be re-published.  It appears that the World of Art Web Service looses the reference to the  ArtWorldObjects in the <a href="http://lexicon-software.com/world-of-art-domain-class-diagram-v1-0/" title="World of Art Domain – Class Diagram V1.0" target="_blank">World of Art Domain</a>.</strong></p>
<div id="attachment_1341" class="wp-caption aligncenter" style="width: 724px"><a href="http://lexicon-software.com/2012/08/29/deployment-of-the-wcf-web-service/publishwebservicelex-1-2/" rel="attachment wp-att-1341"><img src="http://lexicon-software.com/wp-content/uploads/2012/08/PublishWebServiceLex-11.jpg" alt="Publish WCF Web Service in Visual Studio 2010" title="Publish WCF Web Service in Visual Studio 2010" width="714" height="719" class="size-full wp-image-1341" /></a><p class="wp-caption-text">Publish WCF Web Service in Visual Studio 2010 to hosting provider Winhost</p></div>
<p>My hosting provider, WinHost, fully supports IIS 7 hosting for my .NET web apps and WCF web services. In the illustration below, I&#8217;m using the IIS 7 Manager to remotely manage the IIS 7 server where my applications have been deployed. </p>
<p><a href="http://www.iis.net/" title="Microsoft IIS " target="_blank">Internet Information Services</a> (IIS) 7 Manager is an administration UI that provides you with a new way to remotely manage IIS 7.x servers. I recommend reviewing the <a href="http://learn.iis.net/page.aspx/113/getting-started-with-the-iis-manager-in-iis-7-and-iis-8/" title="Getting Started with IIS Manager in IIS 7 and IIS 8" target="_blank">Getting Started with IIS Manager</a> article by Tobin Titus on the IIS.net website. </p>
<div id="attachment_1347" class="wp-caption aligncenter" style="width: 1147px"><a href="http://lexicon-software.com/2012/08/29/deployment-of-the-wcf-web-service/iis-7winhost/" rel="attachment wp-att-1347"><img src="http://lexicon-software.com/wp-content/uploads/2012/08/IIS-7WinHost.jpg" alt="IIS 7  Support at WinHost" title="IIS 7  Support at WinHost" width="1137" height="453" class="size-full wp-image-1347" /></a><p class="wp-caption-text">IIS 7  Support at WinHost</p></div>
<p>As you can see, deployment and remote administration of the World Of Art Web Service, is a very straight forward process. The important thing to remember, is that I put some careful forethought into selecting a hosting provider, that fully supports the combination of technologies exploited in the architectural design of the applications;</p>
<ul>
<li>ASP.net</li>
<li>MS SQL Server</li>
<li>WCF Web Services</li>
<li>IIS 7 Remote Management</li>
<li>One-Click Publishing</li>
</ul>
<p>Visit <a href="http://www.winhost.com/home.aspx?gclid=CMDTtsDfjLICFcdNTAodFA0A1Q" title="WinHost" target="_blank">WinHost</a> for more information.</p>
<p>In my next post, we begin discussions about the <a href="http://lexicon-software-apps.com/Views/ArtistEntityAjax.aspx" title="World of Art Ajax Client" target="_blank">World of Art Client</a>, which is consuming the artist data from the World of Art Web Service.</p>
]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/08/29/deployment-of-the-wcf-web-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration of the WCF Web Service</title>
		<link>http://lexicon-software.com/2012/08/26/configuration-of-the-wcf-web-service/</link>
		<comments>http://lexicon-software.com/2012/08/26/configuration-of-the-wcf-web-service/#comments</comments>
		<pubDate>Sun, 26 Aug 2012 17:24:39 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[World Of Art Web App]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1286</guid>
		<description><![CDATA[Depending on the requirements of the application, configuration of a WCF web service can be simple and straightforward, or sophisticated and complex. This first iteration of the World of Art Web Service has very simple requirements, so I&#8217;ve attempted to keep &#8230; <a href="http://lexicon-software.com/2012/08/26/configuration-of-the-wcf-web-service/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Depending on the requirements of the application, configuration of a WCF web service can be simple and straightforward, or sophisticated and complex. This first iteration of the World of Art Web Service has very simple requirements, so I&#8217;ve attempted to keep the configuration as straightforward as possible. Here is the Web.Configuration file from the web service.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;connectionStrings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ApplicationServices&quot;</span> <span style="color: #000066;">connectionString</span>=<span style="color: #ff0000;">&quot;Data Source=tcp:s07.winhost.com;Initial Catalog=DB_38836_aspnetdb;User ID=DB_38836_aspnetdb_user;Password=**********;Integrated Security=False;&quot;</span> <span style="color: #000066;">providerName</span>=<span style="color: #ff0000;">&quot;System.Data.SqlClient&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ConnectionStringArtWorld&quot;</span> <span style="color: #000066;">connectionString</span>=<span style="color: #ff0000;">&quot;Data Source=tcp:s07.winhost.com;Initial Catalog=DB_38836_aspnetdb;User ID=DB_38836_aspnetdb_user;Password=**********;Integrated Security=False;&quot;</span> <span style="color: #000066;">providerName</span>=<span style="color: #ff0000;">&quot;System.Data.SqlClient&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;DB_38836_aspnetdbConnectionString&quot;</span> <span style="color: #000066;">connectionString</span>=<span style="color: #ff0000;">&quot;Data Source=s07.winhost.com;Initial Catalog=DB_38836_aspnetdb;Persist Security Info=True;User ID=DB_38836_aspnetdb_user;Password=**********&quot;</span> <span style="color: #000066;">providerName</span>=<span style="color: #ff0000;">&quot;System.Data.SqlClient&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;WorldOfArtContext&quot;</span> <span style="color: #000066;">connectionString</span>=<span style="color: #ff0000;">&quot;metadata=res://*/DataModels.WorldOfArt.csdl|res://*/DataModels.WorldOfArt.ssdl|res://*/DataModels.WorldOfArt.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=s07.winhost.com;initial catalog=DB_38836_aspnetdb;persist security info=True;user id=DB_38836_aspnetdb_user;password=**********;multipleactiveresultsets=True;App=EntityFramework&amp;quot;&quot;</span> <span style="color: #000066;">providerName</span>=<span style="color: #ff0000;">&quot;System.Data.EntityClient&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/connectionStrings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.web<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compilation</span> <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">targetFramework</span>=<span style="color: #ff0000;">&quot;4.0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;httpRuntime</span> <span style="color: #000066;">maxRequestLength</span>=<span style="color: #ff0000;">&quot;524288&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.web<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.serviceModel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;behaviors<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;endpointBehaviors<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;behavior</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;webHttpBehavior&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;webHttp</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/behavior<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/endpointBehaviors<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/behaviors<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bindings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;webHttpBinding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;binding</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;webHttpBindingWithJsonP&quot;</span> <span style="color: #000066;">crossDomainScriptAccessEnabled</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/webHttpBinding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bindings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;services<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;WorldOfArtServiceApp.ArtService&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;endpoint</span> <span style="color: #000066;">address</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">binding</span>=<span style="color: #ff0000;">&quot;webHttpBinding&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">bindingConfiguration</span>=<span style="color: #ff0000;">&quot;webHttpBindingWithJsonP&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">contract</span>=<span style="color: #ff0000;">&quot;WorldOfArtServiceApp.IArtService&quot;</span></span>
<span style="color: #009900;">                  <span style="color: #000066;">behaviorConfiguration</span>=<span style="color: #ff0000;">&quot;webHttpBehavior&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/services<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.serviceModel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.webServer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;modules</span> <span style="color: #000066;">runAllManagedModulesForAllRequests</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.webServer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>The first thing to notice is the ConnectionStrings tag. Since the World of Art Web Service references the <a href="http://lexicon-software.com/2012/05/03/client-consuming-from-the-data-access-layer/" title="Client Consuming From The Data Access Layer" target="_blank">Data Access Layer</a> and the <a href="http://lexicon-software.com/generating-data-model-based-on-relational-database/" title="Generating Data Model Based on Relational Database" target="_blank">Data Model</a>, from the World of Art Web App, it is necessary to provide the database connection information to the web service. </p>
<p>Now, lets discuss the configuration of the World of Art Web Service. Configuring the service in the Web.config file, gives us the same flexibility in deployment and management of the web service, as configuring a web application in the Web.config file. Instead of hard coding configuration elements in the application code, it is preferable to expose this information in the configuration file. This will allow an administrator to configure the application for final deployment, without having to modify code and rebuild the application. </p>
<p>The World of Art Web Service, is based on the <a href="http://msdn.microsoft.com/en-us/library/ms731082.aspx" title="Windows Communication Foundation (WCF)" target="_blank">Windows Communication Foundation</a> (WCF) and will be hosted by <a href="http://www.iis.net/" title="Internet Information Services (IIS)" target="_blank">Internet Information Services</a> (IIS). The web service run time environment is .NET Framework version 4.  Therefore, this configuration is specific to a <a href="http://msdn.microsoft.com/en-us/library/ms733766.aspx" title="How to: Host a WCF Service in IIS" target="_blank">WCF services hosted in IIS</a>. IIS depends on the mark up found in the .svc file to implement the WCF service. My hosting provider, Winhost, supports all of these components. </p>
<p>The WCF configuration scheme includes three major sections;</p>
<ul>
<li>serviceModel</li>
<li>bindings</li>
<li>services</li>
</ul>
<p>Here is the serviceModel seciton ;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xhtml" style="font-family:monospace;">&lt;system.serviceModel&gt;
    &lt;behaviors&gt;
      &lt;endpointBehaviors&gt;
        &lt;behavior name=&quot;webHttpBehavior&quot;&gt;
          &lt;webHttp /&gt;
        &lt;/behavior&gt;
      &lt;/endpointBehaviors&gt;
    &lt;/behaviors&gt;
    &lt;bindings&gt;
      &lt;webHttpBinding&gt;
        &lt;binding name=&quot;webHttpBindingWithJsonP&quot; crossDomainScriptAccessEnabled=&quot;true&quot; /&gt;
      &lt;/webHttpBinding&gt;
    &lt;/bindings&gt;
    &lt;services&gt;
      &lt;service name=&quot;WorldOfArtServiceApp.ArtService&quot;&gt;
        &lt;endpoint address=&quot;&quot; binding=&quot;webHttpBinding&quot;
                  bindingConfiguration=&quot;webHttpBindingWithJsonP&quot;
                  contract=&quot;WorldOfArtServiceApp.IArtService&quot;
                  behaviorConfiguration=&quot;webHttpBehavior&quot;/&gt;
      &lt;/service&gt;
    &lt;/services&gt;
  &lt;/system.serviceModel&gt;</pre></td></tr></table></div>

<p>The entire service configuration is bound by the <a href="http://msdn.microsoft.com/en-us/library/ms731354.aspx" title="system.serviceModel element" target="_blank">system.serviceModel</a> elelment. Lets first examine the <a href="http://msdn.microsoft.com/en-us/library/ms731360.aspx" title="services Element" target="_blank">services</a> element. Within services we find one or more <a href="http://msdn.microsoft.com/en-us/library/ms731303.aspx" title="service Element" target="_blank">service</a> elements. It has a name attribute to identify the service. Within the service element, the <a href="http://msdn.microsoft.com/en-us/library/ms731320.aspx" title="endpoint Element" target="_blank">endpoint</a> element is used to configure one or more service endpoints. Notice how the address attribute has a null value. Since this service is hosted in IIS, it&#8217;s not necessary to specify an endpoint address. In fact, specifying a fully qualified endpoint address can lead to deployment errors in IIS. With an IIS hosted WCF service, the end point address is always relative to the .svc file that represents the service. </p>
<p>The binding attributes of the endpoint element, specify how the endpoint communicates with the world, in terms of transport and protocol schemes. In this case, I specified the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.webhttpbinding.aspx" title="WebHttpBinding Class" target="_blank">WebHttpBinding</a> Class. A binding used to configure endpoints for WCF Web services that are exposed through HTTP requests instead of SOAP messages. I am also utilizing the bindingConfiguration attribute of the endpoint element. This attribute is used in conjunction with binding to reference a specific binding configuration in the configuration file. In this case it is referencing a <a href="http://msdn.microsoft.com/en-us/library/ms731399.aspx" title="binding Element" target="_blank">binding</a> elelment in the webHttpBinding section named &#8220;webHttpBindingWithJsonP&#8221;, where I specify a custom binding configuration using the crossDomainScriptAccessEnabled, which is set to true. I will discuss cross domain access to web services in a future post.   </p>
<p>The final attribute of the endpoint element is the behavior configuration attribute. I gave the behavior configuration a unique name of &#8220;webHttpBehavior&#8221;.  The configuration of the endpoint itself can be found in the <a href="http://msdn.microsoft.com/en-us/library/ms731403.aspx" title="behvior of endpointBehaviors" target="_blank">behavior element of endpoint behaviors</a> section. The only required element I utilized is the <a href="http://msdn.microsoft.com/en-us/library/bb924425.aspx" title="webHttp Element" target="_blank">webHttp</a> element. This element specifies the WebHttpBehavior on an endpoint through configuration. This behavior, when used in conjunction with the webHttpBinding standard binding, enables the Web programming model for a Windows Communication Foundation (WCF) service. I simply took all of the default values for attributes in the webHttp element. </p>
<p>As you can see, it is absolutely necessary to completely understand the operational requirements of the WCF web service, prior to configuration. There is a lot of flexibility in this area of WCF. However, with more flexibility comes more responsibility. In my next post I will cover deployment of the WCF web service.</p>
]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/08/26/configuration-of-the-wcf-web-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Contract and Data Member Attributes Complete the Service Contract</title>
		<link>http://lexicon-software.com/2012/08/18/the-data-member-attribute-completes-the-service-contract/</link>
		<comments>http://lexicon-software.com/2012/08/18/the-data-member-attribute-completes-the-service-contract/#comments</comments>
		<pubDate>Sat, 18 Aug 2012 15:07:52 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1277</guid>
		<description><![CDATA[As I stated several times in recent posts, the purpose of the Art Service is not to expose the business logic of the World of Art web app. Instead, the purpose of the Art Service, is to simply expose specific &#8230; <a href="http://lexicon-software.com/2012/08/18/the-data-member-attribute-completes-the-service-contract/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>As I stated several times in recent posts, the purpose of the Art Service is not to expose the business logic of the World of Art web app. Instead, the purpose of the Art Service, is to simply expose specific data elements from the World of Art domain, which can be served upon request, to various software clients. We have already discussed in detail, how the service contract attribute and the operation contract attribute, transform a simple interface and class implementation, into an actual web service. Now lets look at how we can complete the details of the service contract, by specifying exactly which data elements are to be exposed by the web service.</p>
<p>In the early phases of development, I isolated the entities of the <a title="Defining the App Domain" href="http://lexicon-software.com/2012/03/20/defining-the-app-domain/" target="_blank">world of art domain</a> into a separate class library called ArtWorldObjects. Artist is one of the entities defined in this class library. At this time, I want the WorldOfArtServiceApp to only expose the Artist object, and more specifically, only certain properties of the Artist object. To acomplish this, I will utilize the <a title="Data Contract Attribute Class" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx" target="_blank">Data Contract Attribute</a> Class and the <a title="Data Member Attribute Class" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.aspx" target="_blank">Data Member Attribute</a> Class. The data contract attribute specifies that the type defines or implements a data contract. The data member contract, when applied to the member of a type, specifies that the member is part of a data contract, and can be serialized by the <a title="Data Contract Serializer Class" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx" target="_blank">DataContractSerializer</a> Class.</p>
<p>Here is the source code for the IArtist interface and the Artist class, with data contract attribute and data member attribute applied;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Runtime.Serialization</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> ArtWorldObjects
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">interface</span> IArtist
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008000;">&#91;</span>DataMember<span style="color: #008000;">&#93;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> Name
        <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">get</span><span style="color: #008000;">;</span> <span style="color: #0600FF; font-weight: bold;">set</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        DateTime DateOfBirth
        <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">get</span><span style="color: #008000;">;</span> <span style="color: #0600FF; font-weight: bold;">set</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>DataMember<span style="color: #008000;">&#93;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> DateOfBirthShortString
        <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">get</span><span style="color: #008000;">;</span> <span style="color: #0600FF; font-weight: bold;">set</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>DataMember<span style="color: #008000;">&#93;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> DateOfBirthLongString
        <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">get</span><span style="color: #008000;">;</span> <span style="color: #0600FF; font-weight: bold;">set</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>DataMember<span style="color: #008000;">&#93;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> PlaceOfBirth
        <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">get</span><span style="color: #008000;">;</span> <span style="color: #0600FF; font-weight: bold;">set</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        ArtistTypes<span style="color: #008000;">.</span><span style="color: #0000FF;">TypesOfArtists</span> Type
        <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">get</span><span style="color: #008000;">;</span> <span style="color: #0600FF; font-weight: bold;">set</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        Int64 ID
        <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">get</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        ArtPiece CreateWorkOfArt<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Runtime.Serialization</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> ArtWorldObjects
<span style="color: #008000;">&#123;</span>
    <span style="color: #008000;">&#91;</span>DataContract<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span>  <span style="color: #6666cc; font-weight: bold;">class</span> Artist <span style="color: #008000;">:</span> IArtist
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">string</span> artistName<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> DateTime dateOfBirth<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">string</span> placeOfBirth<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> ArtistTypes<span style="color: #008000;">.</span><span style="color: #0000FF;">TypesOfArtists</span> typeOfArtist<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> ArtPiece workOfArt<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> Int64 artistID<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> Artist<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
&nbsp;
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>DataMember<span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> artistName<span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">set</span>
            <span style="color: #008000;">&#123;</span>
                artistName <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">value</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> DateTime DateOfBirth
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> dateOfBirth<span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">set</span>
            <span style="color: #008000;">&#123;</span>
                dateOfBirth <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">value</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>DataMember<span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> DateOfBirthShortString
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> DateOfBirth<span style="color: #008000;">.</span><span style="color: #0000FF;">ToShortDateString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">set</span>
            <span style="color: #008000;">&#123;</span>
                DateOfBirthShortString <span style="color: #008000;">=</span> DateOfBirth<span style="color: #008000;">.</span><span style="color: #0000FF;">ToShortDateString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>DataMember<span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> DateOfBirthLongString
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> DateOfBirth<span style="color: #008000;">.</span><span style="color: #0000FF;">ToLongDateString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">set</span>
            <span style="color: #008000;">&#123;</span>
                DateOfBirthLongString <span style="color: #008000;">=</span> DateOfBirth<span style="color: #008000;">.</span><span style="color: #0000FF;">ToLongDateString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>DataMember<span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> PlaceOfBirth
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> placeOfBirth<span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">set</span>
            <span style="color: #008000;">&#123;</span>
                placeOfBirth <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">value</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> ArtistTypes<span style="color: #008000;">.</span><span style="color: #0000FF;">TypesOfArtists</span> Type
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> typeOfArtist<span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">set</span>
            <span style="color: #008000;">&#123;</span>
                typeOfArtist <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">value</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> ArtPiece CreateWorkOfArt<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> workOfArt<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">long</span> ID
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> artistID<span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Click on this link; <span style="text-decoration: underline;"><a title="Artist Data in JSON format" href="http://lexicon-software-apps.com/ArtService.svc/GetArtists" target="_blank">Artists in JSON Format</a></span> to send a &#8220;GET&#8221; request to the World of Art Web Service app. You can also copy the following link into your browser&#8217;s address bar to retrieve the JSON data;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xhtml" style="font-family:monospace;">http://lexicon-software-apps.com/ArtService.svc/GetArtists</pre></td></tr></table></div>

<p>Upon examining the JSON text returned by the service, you will see that the only properties of artist returned by the web service, are those enhanced with the Data Member attribute. Here is what the artist data in JSON format looks like;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">[{&quot;DateOfBirthLongString&quot;:&quot;Thursday, August 04, 1960&quot;,&quot;DateOfBirthShortString&quot;:&quot;8\/4\/1960&quot;,&quot;ExceptionMessage&quot;:&quot;No Errors&quot;,&quot;Name&quot;:&quot;Michael Swearngin&quot;,&quot;PlaceOfBirth&quot;:&quot;Olathe, Kansas United States&quot;},{&quot;DateOfBirthLongString&quot;:&quot;Monday, January 01, 1753&quot;,&quot;DateOfBirthShortString&quot;:&quot;1\/1\/1753&quot;,&quot;ExceptionMessage&quot;:&quot;No Errors&quot;,&quot;Name&quot;:&quot;Michelangelo di Lodovico Buonarroti Simoni&quot;,&quot;PlaceOfBirth&quot;:&quot;Florence Italy&quot;},{&quot;DateOfBirthLongString&quot;:&quot;Monday, January 01, 1753&quot;,&quot;DateOfBirthShortString&quot;:&quot;1\/1\/1753&quot;,&quot;ExceptionMessage&quot;:&quot;No Errors&quot;,&quot;Name&quot;:&quot;Donatello di Niccolo` di Betto&quot;,&quot;PlaceOfBirth&quot;:&quot;Florence Italy&quot;},{&quot;DateOfBirthLongString&quot;:&quot;Monday, January 01, 1753&quot;,&quot;DateOfBirthShortString&quot;:&quot;1\/1\/1753&quot;,&quot;ExceptionMessage&quot;:&quot;No Errors&quot;,&quot;Name&quot;:&quot;Sandro Botticelli&quot;,&quot;PlaceOfBirth&quot;:&quot;Florence Italy&quot;},{&quot;DateOfBirthLongString&quot;:&quot;Monday, January 01, 1753&quot;,&quot;DateOfBirthShortString&quot;:&quot;1\/1\/1753&quot;,&quot;ExceptionMessage&quot;:&quot;No Errors&quot;,&quot;Name&quot;:&quot;Leonardo da Vinci&quot;,&quot;PlaceOfBirth&quot;:&quot;Florence Italy&quot;},{&quot;DateOfBirthLongString&quot;:&quot;Monday, August 06, 1928&quot;,&quot;DateOfBirthShortString&quot;:&quot;8\/6\/1928&quot;,&quot;ExceptionMessage&quot;:&quot;No Errors&quot;,&quot;Name&quot;:&quot;Andy Warhol&quot;,&quot;PlaceOfBirth&quot;:&quot;Pittsburgh, Pennsylvania United States&quot;},{&quot;DateOfBirthLongString&quot;:&quot;Saturday, November 14, 1840&quot;,&quot;DateOfBirthShortString&quot;:&quot;11\/14\/1840&quot;,&quot;ExceptionMessage&quot;:&quot;No Errors&quot;,&quot;Name&quot;:&quot;Claude Monet&quot;,&quot;PlaceOfBirth&quot;:&quot;Paris France&quot;},{&quot;DateOfBirthLongString&quot;:&quot;Friday, November 25, 1881&quot;,&quot;DateOfBirthShortString&quot;:&quot;11\/25\/1881&quot;,&quot;ExceptionMessage&quot;:&quot;No Errors&quot;,&quot;Name&quot;:&quot;Pablo Picasso&quot;,&quot;PlaceOfBirth&quot;:&quot;Malaga Spain&quot;}]</pre></td></tr></table></div>

<p>For the sake of convenience I added three properties, of type string, to the IArtist Interface;</p>
<ul>
<li>ExceptionMessage &#8211; messages to communicate any problems to the client</li>
<li>DateOfBirthShortString &#8211; date in &#8220;mm/dd/yyyy&#8221; format</li>
<li>DateOfBirthLongString &#8211; date in fomat &#8220;Monday, August 06, 1928&#8243;</li>
</ul>
<p>The short and long data formats where necessary, because I discovered that when type System.DateTime is serialized to JSON, a very nasty date format is produced. Something like this; &#8220;DateOfBirth&#8221;:&#8221;\/Date(-296931600000-0700)\/&#8221;. Therefore, I excluded the date of birth property with a type of System.DateTime from being a Data Member. However, you can see in the source code, that the short and long date of birth properties are derived from the System.DateTime date of birth property.</p>
<p>In my next post, I will cover the configuration and deployment of the World Of Art Web Service. After that, I will cover the client, which uses JavaScript to consume artist data from the web service. This link; <span style="text-decoration: underline;"><a title="Request artist information from The World of Art" href="http://lexicon-software-apps.com/Views/ArtistEntityAjax.aspx" target="_blank">Artists from the Web Service</a></span> will launch the client in the World of Art Web App.</p>
]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/08/18/the-data-member-attribute-completes-the-service-contract/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementation of the Web Service Interface</title>
		<link>http://lexicon-software.com/2012/08/17/implementation-of-the-web-service-interface/</link>
		<comments>http://lexicon-software.com/2012/08/17/implementation-of-the-web-service-interface/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 11:44:45 +0000</pubDate>
		<dc:creator>Tim Daniels</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Blog Topics]]></category>
		<category><![CDATA[Data Model]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://lexicon-software.com/?p=1250</guid>
		<description><![CDATA[In my last post, we discussed the interface of the WCF application and how it forms a mutually binding contract, between the client and the service. The client must make their request in a format the service is expecting, and &#8230; <a href="http://lexicon-software.com/2012/08/17/implementation-of-the-web-service-interface/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In my last post, we discussed the interface of the WCF application and how it forms a mutually binding contract, between the client and the service. The client must make their request in a format the service is expecting, and the service must fulfill the request in the format specified in the contract. This is all defined in the operation contract of the IArtService interface.   </p>
<ul>
<li>The request must be an XMLHttpRequest using the &#8220;GET&#8221; verb</li>
<li>The &#8220;GET&#8221; request must specifically request access to the ArtService.svc and the GetArtists method</li>
<li>The service must respond to the request with data serialized into the Json format</li>
</ul>
<p>Here is a simple JavaScript function which would satisfy the contractual requirements for a request;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="script" style="font-family:monospace;">function getArtistsAjax() {
    $.ajax({
        type: 'GET',
        url: 'http://lexicon-software-apps.com/ArtService.svc/GetArtists?callback=updateArtists',
        dataType: &quot;jsonp&quot;,
        success: function (result) {
            updateArtists(result);
        }
    });
}</pre></td></tr></table></div>

<p>Once again, here is the IArtService interface where the mutually binding contract between the service and clients is defined;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Runtime.Serialization</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.ServiceModel</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.ServiceModel.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">ArtWorldObjects</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> WorldOfArtServiceApp
<span style="color: #008000;">&#123;</span>
    <span style="color: #008000;">&#91;</span>ServiceContract<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">interface</span> IArtService
    <span style="color: #008000;">&#123;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>OperationContract<span style="color: #008000;">&#93;</span>
        <span style="color: #008000;">&#91;</span>WebGet<span style="color: #008000;">&#40;</span>ResponseFormat <span style="color: #008000;">=</span> WebMessageFormat<span style="color: #008000;">.</span><span style="color: #0000FF;">Json</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
        List<span style="color: #008000;">&lt;</span>Artist<span style="color: #008000;">&gt;</span> GetArtists<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
  <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>As you can see, the interface also uses the <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.aspx" title="System.Runtime.Serialization Namespace" target="_blank">System.Runtime.Serialization</a> and <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.web.aspx" title="System.ServiceModel.Web Namespace" target="_blank">System.ServiceModel.web</a> name spaces to fulfill the request. </p>
<p>Now, lets examine the implementation of the IArtService interface. Here is the source code of the ArtService class which implements the IArtService interface;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Runtime.Serialization</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.ServiceModel</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.ServiceModel.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.ServiceModel.Activation</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Net</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">ArtWorldObjects</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">WorldOfArtWebApp.DataAccess</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> WorldOfArtServiceApp
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> ArtService <span style="color: #008000;">:</span> IArtService
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> ArtWorldCollectionArtist artistData<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> List<span style="color: #008000;">&lt;</span>Artist<span style="color: #008000;">&gt;</span> GetArtists<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">try</span>
            <span style="color: #008000;">&#123;</span>
                artistData <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ArtWorldCollectionArtist<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>artistData<span style="color: #008000;">.</span><span style="color: #0000FF;">ArtWorldCollection</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span> <span style="color: #008000;">&amp;&amp;</span> artistData<span style="color: #008000;">.</span><span style="color: #0000FF;">ExceptionMessage</span> <span style="color: #008000;">==</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    <span style="color: #0600FF; font-weight: bold;">return</span> artistData<span style="color: #008000;">.</span><span style="color: #0000FF;">ArtWorldCollection</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
                <span style="color: #0600FF; font-weight: bold;">else</span>
                <span style="color: #008000;">&#123;</span>
                    <span style="color: #0600FF; font-weight: bold;">throw</span> <span style="color: #008000;">new</span> WebFaultException<span style="color: #008000;">&#40;</span>HttpStatusCode<span style="color: #008000;">.</span><span style="color: #0000FF;">BadRequest</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">catch</span> 
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">throw</span> <span style="color: #008000;">new</span> WebFaultException<span style="color: #008000;">&#40;</span>HttpStatusCode<span style="color: #008000;">.</span><span style="color: #0000FF;">BadRequest</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>As I stated in an earlier post, the purpose of the Art Service Class is not to expose the business logic of the World of Art web app. Instead, the purpose of the Art Service, is to simply expose specific data elements from the World of Art domain, which can be served upon request, to various software clients. In order to retrieve data from the world of art domain, the ArtService class references two name spaces from the WorldOfArtWebApp;</p>
<ul>
<li>ArtWorldObjects</li>
<li>WorldOfArtWebApp.DataAccess</li>
</ul>
<p>With these references, the GetArtist() method can reuse components of the WorldOfArtWebApp from the <a href="http://lexicon-software.com/2012/04/11/separation-of-concerns-data-access-layer/" title="Separation of Concerns – Data Access Layer" target="_blank">Data Access Layer</a> and the <a href="http://lexicon-software.com/2012/04/09/the-data-model-layer/" title="The Data Model Layer" target="_blank">Data Model</a> defined in the Entity Framework.</p>
<p>The GetArtist() method is bound by the Operation Contract, defined in the IArtService interface, to return a list of artist objects. This requirement is satisfied by simply creating a new instance of the ArtWorldCollectionArtist Class, and accessing the collection of artist objects in the ArtWorldCollection property. The collection of artist objects is retrieved from the WorldOfArtContext, generated from the Entity Framework. The WCF web service will serialize each of this artist objects into JSON format as specified in the operation contract.</p>
<p>In my next post, I will discuss how to specify which properties of the Artist object are exposed to the web service. Also, here is the source code for the ArtWorldCollectionArtist class, invoked by the GetArtist() method.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Data.Objects</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">ArtWorldObjects</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">WorldOfArtWebApp.DataModels</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> WorldOfArtWebApp<span style="color: #008000;">.</span><span style="color: #0000FF;">DataAccess</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> ArtWorldCollectionArtist <span style="color: #008000;">:</span> IArtWorldCollection<span style="color: #008000;">&lt;</span>Artist<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> WorldOfArtContext m_WorldOfArtEntities<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> List<span style="color: #008000;">&lt;</span>Artist<span style="color: #008000;">&gt;</span> m_artistList<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">string</span> m_exceptionMessage<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> Artist m_artist<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> ArtWorldCollectionArtist<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            m_exceptionMessage <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">;</span>
            m_WorldOfArtEntities <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WorldOfArtContext<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            m_artistList <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span>Artist<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            GetArtCollectionData<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> ObjectContext WorksOfArtContext
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> m_WorldOfArtEntities<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> List<span style="color: #008000;">&lt;</span>Artist<span style="color: #008000;">&gt;</span> ArtWorldCollection
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> m_artistList<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> ExceptionMessage
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">get</span> <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> m_exceptionMessage<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> GetArtCollectionData<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">try</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>m_WorldOfArtEntities<span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    <span style="color: #0600FF; font-weight: bold;">var</span> artistQuery <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">from</span> artists <span style="color: #0600FF; font-weight: bold;">in</span> m_WorldOfArtEntities<span style="color: #008000;">.</span><span style="color: #0000FF;">aspnet_Artist</span>
                                      <span style="color: #0600FF; font-weight: bold;">select</span> artists<span style="color: #008000;">;</span>
                    <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">var</span> artist <span style="color: #0600FF; font-weight: bold;">in</span> artistQuery<span style="color: #008000;">&#41;</span>
                    <span style="color: #008000;">&#123;</span>
                        m_artist <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Artist<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                        m_artist<span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> artist<span style="color: #008000;">.</span><span style="color: #0000FF;">FirstName</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot; &quot;</span> <span style="color: #008000;">+</span> artist<span style="color: #008000;">.</span><span style="color: #0000FF;">LastName</span><span style="color: #008000;">;</span>
                        m_artist<span style="color: #008000;">.</span><span style="color: #0000FF;">PlaceOfBirth</span> <span style="color: #008000;">=</span> artist<span style="color: #008000;">.</span><span style="color: #0000FF;">City</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot; &quot;</span> <span style="color: #008000;">+</span> artist<span style="color: #008000;">.</span><span style="color: #0000FF;">Country</span><span style="color: #008000;">;</span>
                        m_artist<span style="color: #008000;">.</span><span style="color: #0000FF;">DateOfBirth</span> <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span>DateTime<span style="color: #008000;">&#41;</span>artist<span style="color: #008000;">.</span><span style="color: #0000FF;">BirthDay</span><span style="color: #008000;">;</span>
&nbsp;
                        m_artistList<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Add</span><span style="color: #008000;">&#40;</span>m_artist<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #008000;">&#125;</span>
                <span style="color: #008000;">&#125;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception ex<span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                m_exceptionMessage <span style="color: #008000;">=</span> ex<span style="color: #008000;">.</span><span style="color: #0000FF;">Message</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> Artist<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> GetListOfArtist<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            Artist<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> artistList <span style="color: #008000;">=</span> ArtWorldCollection<span style="color: #008000;">.</span><span style="color: #0000FF;">ToArray</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> artistList<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://lexicon-software.com/2012/08/17/implementation-of-the-web-service-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
