<?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>Restafarian.org &#187; Design</title>
	<atom:link href="http://blog.restafarian.org/category/design/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.restafarian.org</link>
	<description>What’s in a name? That which we call a rose By any other name would smell as sweet.</description>
	<lastBuildDate>Sat, 24 Jul 2010 01:47:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>It&#8217;s a brand new project!</title>
		<link>http://blog.restafarian.org/2009/04/its-a-brand-new-project/</link>
		<comments>http://blog.restafarian.org/2009/04/its-a-brand-new-project/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 01:06:12 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[servlet]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=536</guid>
		<description><![CDATA[After rebuilding a few of the old project web sites, I started looking a little more closer at some the reports that are generated by Maven and realized that I don&#8217;t have any unit tests that cover any of the servlets in the portfolio. The main reason for that, it turns out, is that I [...]]]></description>
			<content:encoded><![CDATA[<p>After <a title="DAO Refactoring: Finishing up with Approval" href="http://blog.restafarian.org/2009/04/dao-refactoring-finishing-up-with-approval/" target="_self">rebuilding a few of the old project web sites</a>, I started looking a little more closer at some the reports that are generated by <a title="http://maven.apache.org/" href="http://maven.apache.org/" target="_blank">Maven</a> and realized that I <a title="http://www.restafarian.org/projects/approval-web/cobertura/index.html" href="http://www.restafarian.org/projects/approval-web/cobertura/index.html" target="_blank">don&#8217;t have any unit tests</a> that cover any of the servlets in the portfolio. The main reason for that, it turns out, is that I have no idea how to go about doing that, so I started nosing around the web looking for guidance.</p>
<p>After googling around here and there for different things, I came across a number of interesting and useful items such as <a title="http://www.developer.com/java/ent/article.php/3456691" href="http://www.developer.com/java/ent/article.php/3456691" target="_blank">this one</a>, which got me thinking about different ways to help expedite the process using some generic base tester classes that could be extended as needed. We already have something like that <a title="http://trac2.assembla.com/restafarian/browser/core/trunk/src/test/java/org/restafarian/core/dao/BaseDaoTestCase.java" href="http://trac2.assembla.com/restafarian/browser/core/trunk/src/test/java/org/restafarian/core/dao/BaseDaoTestCase.java" target="_blank">here</a>, which later had to be duplicated <a title="http://trac2.assembla.com/restafarian/browser/notify/trunk/src/test/java/org/restafarian/notify/dao/BaseDaoTestCase.java" href="http://trac2.assembla.com/restafarian/browser/notify/trunk/src/test/java/org/restafarian/notify/dao/BaseDaoTestCase.java" target="_blank">here</a> and then again <a title="http://trac2.assembla.com/restafarian/browser/approval/trunk/src/test/java/org/restafarian/approval/dao/BaseDaoTestCase.java" href="http://trac2.assembla.com/restafarian/browser/approval/trunk/src/test/java/org/restafarian/approval/dao/BaseDaoTestCase.java" target="_blank">here</a>.</p>
<p>I really don&#8217;t like having things in more than one place, and when it looked as if I would have to do the same kind of thing again for any servlet testing tools, I decided that it was time for a new .jar file dedicated exclusively to those items whose sole purpose was to support testing. It may only end up with a few things in it, but these are things that I don&#8217;t want to put in the core .jar, as they are only used during the testing phase, and I don&#8217;t want to have to duplicate all over, either.</p>
<p>This new project will be a new Maven project called <strong>core-test</strong>, and will produce the <em>core-test.jar</em> file, which will become a test-scope dependency for those projects that can benefit from any of its contents. Now, if the test coverage report on <em>this</em> project starts to bother me, I&#8217;ll have to come up with unit tests to test the unit testing tools, but for now, I think I&#8217;ll just try not to look too closely at that report! We&#8217;ll just focus on the code, starting with the <a title="http://trac2.assembla.com/restafarian/browser/core-test/trunk/src/main/java/org/restafarian/core/test/dao/BaseDaoTestCase.java" href="http://trac2.assembla.com/restafarian/browser/core-test/trunk/src/main/java/org/restafarian/core/test/dao/BaseDaoTestCase.java" target="_blank">BaseDaoTestCase</a>, which we can now yank out of all of the places where it is currently found and reference from here instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2009/04/its-a-brand-new-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DAO Refactoring: Package clean-up</title>
		<link>http://blog.restafarian.org/2009/04/dao-refactoring-package-clean-up/</link>
		<comments>http://blog.restafarian.org/2009/04/dao-refactoring-package-clean-up/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 20:45:58 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[dao]]></category>
		<category><![CDATA[dao refactoring]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=510</guid>
		<description><![CDATA[So far in our efforts to refactor the Approval System&#8217;s data access strategy, we have created four new packages: org.restafarian.approval.dao org.restafarian.approval.dao.impl org.restafarian.approval.manager org.restafarian.approval.manager.impl We can now delete the original RequestForApprovalManager in the old org.restafarian.approval.data package, and we could even delete the package itself, were it not for the presence of another remaining class, the RestServiceManager. [...]]]></description>
			<content:encoded><![CDATA[<p>So far in our efforts to <a title="DAO Refactoring: Taking on the Approval Service" href="http://blog.restafarian.org/2009/04/dao-refactoring-taking-on-the-approval-service/" target="_self">refactor the Approval System&#8217;s data access strategy</a>, we have created four new packages:</p>
<ul>
<li><a title="DAO Refactoring: RequestForApprovalDao" href="http://blog.restafarian.org/2009/04/dao-refactoring-requestforapprovaldao/" target="_self">org.restafarian.approval.dao</a></li>
<li><a title="DAO Refactoring: RequestForApprovalDaoHibernate" href="http://blog.restafarian.org/2009/04/dao-refactoring-requestforapprovaldaohibernate/" target="_self">org.restafarian.approval.dao.impl</a></li>
<li>o<a title="DAO Refactoring: RequestForApprovalManager" href="http://blog.restafarian.org/2009/04/dao-refactoring-requestforapprovalmanager/" target="_self">rg.restafarian.approval.manager</a></li>
<li><a title="DAO Refactoring: RequestForApprovalManagerImpl" href="http://blog.restafarian.org/2009/04/dao-refactoring-requestforapprovalmanagerimpl/" target="_self">org.restafarian.approval.manager.impl</a></li>
</ul>
<p>We can now delete the original <a title="http://trac2.assembla.com/restafarian/browser/approval/trunk/src/main/java/org/restafarian/approval/data/RequestForApprovalManager.java?rev=11" href="http://trac2.assembla.com/restafarian/browser/approval/trunk/src/main/java/org/restafarian/approval/data/RequestForApprovalManager.java?rev=11http://trac2.assembla.com/restafarian/browser/approval/trunk/src/main/java/org/restafarian/approval/data/RequestForApprovalManager.java?rev=11" target="_blank">RequestForApprovalManager</a> in the old <em>org.restafarian.approval.data</em> package, and we could even delete the package itself, were it not for the presence of another remaining class, the <a title="The Approval Service: Posting the Decision" href="http://blog.restafarian.org/2008/02/the-approval-service-posting-the-decision/" target="_self">RestServiceManager</a>. That one, we have no intention of replacing, but as long as we&#8217;re cleaning things up, I think at this point I&#8217;ll go ahead and rename that package now to <em>org.restafarian.approvalservice.impl</em>, just to bring it in line with the convention used on similar packages in other projects.</p>
<p>That takes care of the Java components in the <strong>approval</strong> project, but we still have some changes to make to the Java servlets in the <strong>approval-web</strong> project as a result of these recent modifications before things will work with new approach. Before we do that, though, we need to create some unit tests back in the <strong>approval</strong> project to complete that entire aspect of the process. Yes, I know, you&#8217;re supposed to do the tests first, but it&#8217;s better late than never. We&#8217;ll jump on that next!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2009/04/dao-refactoring-package-clean-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DAO Refactoring: Taking on the Approval Service</title>
		<link>http://blog.restafarian.org/2009/04/dao-refactoring-taking-on-the-approval-service/</link>
		<comments>http://blog.restafarian.org/2009/04/dao-refactoring-taking-on-the-approval-service/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 01:30:54 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[dao refactoring]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=496</guid>
		<description><![CDATA[Quite some time ago, I took on the process of refactoring all of the DAO components in the Notification Service and the Look-up Table service. I went through a number of variations, all based on the initial inspiration, and eventually settled on a final version for the foundation. I did not, however, go all the [...]]]></description>
			<content:encoded><![CDATA[<p>Quite <a title="DAO Refactoring: AbstractHibernateDao" href="http://blog.restafarian.org/2008/11/dao-refactoring-abstracthibernatedao/" target="_self">some time ago</a>, I took on the process of refactoring all of the DAO components in the <a title="Notification Service: Overview" href="http://blog.restafarian.org/2008/10/notification-service-overview/" target="_self">Notification Service</a> and the <a title="Next Up: Universal look-up tables" href="http://blog.restafarian.org/2008/06/next-up-universal-look-up-tables/" target="_self">Look-up Table</a> service. I went through a number of variations, all based on the <a title="http://raykrueger.blogspot.com/2007/09/best-generic-dao-interface-ever.html" href="http://raykrueger.blogspot.com/2007/09/best-generic-dao-interface-ever.html" target="_blank">initial inspiration</a>, and eventually settled on a <a title="DAO Refactoring: One final(?) version" href="http://blog.restafarian.org/2008/12/dao-refactoring-one-final-version/" target="_self">final version</a> for the foundation. I did not, however, go all the way back and tackle the <a title="The Approval Service: Lifecycle Overview" href="http://blog.restafarian.org/2008/02/the-approval-service-lifecycle-overview/" target="_self">Approval Service</a> or the <a title="Next up: the Authorization service" href="http://blog.restafarian.org/2008/03/next-up-the-authorization-service/" target="_self">Authorization Service</a>, as those were built back in the days before I had fully embraced <a title="Look-up Tables: DAO testing" href="http://blog.restafarian.org/2008/07/look-up-tables-dao-testing/" target="_self">the AppFuse model</a>, <a title="http://www.springsource.org/" href="http://www.springsource.org/" target="_blank">Spring</a>, and all of the related benefits of that particular approach.</p>
<p>In attempting to put together the stand-alone, ready-to-wear zip file of all of these little services, I have come to the realization that it is high time to bite the bullet and just dive in and make these older services look and operate just like the newer ones. That&#8217;s actually a little more work than simply DAO refactoring, but it&#8217;s as good an explanation of the endeavor as any at this point.</p>
<p>Anyway, that&#8217;s the general idea &#8230; we&#8217;ll have to wait and see how it all turns out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2009/04/dao-refactoring-taking-on-the-approval-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notification Service: A little minor enhancement</title>
		<link>http://blog.restafarian.org/2009/04/notification-service-a-little-minor-enhancement/</link>
		<comments>http://blog.restafarian.org/2009/04/notification-service-a-little-minor-enhancement/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 01:33:04 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Notification Service]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[velocity]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=481</guid>
		<description><![CDATA[OK, I have to admit that this a little backwards compared to my normal approach to these types of things. Usually, when an idea comes to mind, I get busy and build out all of the parts and try it out, and if it works the way in which I had envisioned, I make it [...]]]></description>
			<content:encoded><![CDATA[<p>OK, I have to admit that this a little backwards compared to my normal approach to these types of things. Usually, when an idea comes to mind, I get busy and build out all of the parts and try it out, and if it works the way in which I had envisioned, I make it a permanent part of the portfolio and roll it out to where all can.</p>
<p>Today, though, I&#8217;m just going to toss out a little idea without actually doing any real coding, and then hopefully follow this up later on with some tangible parts that will actually work. But first, a little background, just to provide the context.</p>
<p>It&#8217;s been a while since I <a title="Notification Service: Now what (again!)?" href="http://blog.restafarian.org/2008/12/notification-service-now-what-again/" target="_self">completed the major work</a> on the <a title="Notification Service: Overview" href="http://blog.restafarian.org/2008/10/notification-service-overview/" target="_self">Notification Service</a>. Since that time, it&#8217;s been used for a variety of purposes, and in a number of different ways, which was the intent. The basic approach to sending out a notice is something like this:</p>
<pre>notifier.sendNotification(sendTo, templateId, noticeData);</pre>
<p>&#8230; where <em>sendTo</em> is a list of recipients, <em>tempateId</em> is the id of the stock language for the message to be sent out, and <em>noticeData</em> is the data from which values are extracted to resolve variables in the template. Now, the format of the &#8220;data&#8221; passed was intentionally left obscure so that you could choose to implement this element in any way that best fit your particular use of the service. This actually worked quite well, as many people chose many different approaches to populating this element before making the call to send out the notifications.</p>
<p>However, in order for all of this work as it should, there must be a clear understanding between the template designer and the individual passing the data so that the person laying out the message understands what data is going to be made available and how it is to be acessed in the template language. In our <a title="http://trac2.assembla.com/restafarian/browser/notify/trunk/src/main/java/org/restafarian/notify/service/impl/NotifierImpl.java" href="http://trac2.assembla.com/restafarian/browser/notify/trunk/src/main/java/org/restafarian/notify/service/impl/NotifierImpl.java" target="_blank">standard implementatio</a>n of the <a title="http://trac2.assembla.com/restafarian/browser/notify/trunk/src/main/java/org/restafarian/notify/service/Notifier.java" href="http://trac2.assembla.com/restafarian/browser/notify/trunk/src/main/java/org/restafarian/notify/service/Notifier.java" target="_blank">Notifier</a> interface, we use <a title="http://velocity.apache.org/" href="http://velocity.apache.org/" target="_blank">Velocity</a> to resolve all of the variable data, so the templates are written using Velocity syntax. The recipient data is loaded into the Velocity context under the name <em>recipient</em>, and the notice data, in whatever form it is passed, is loaded into the context under the name <em>data</em>. In this way, all recipient data is referenced using the Velocity syntax <strong>$recipient.</strong><em>whatever</em> and all notice data is similarly referenced using <strong>$data</strong>.<em>whatever</em>. It&#8217;s the format of the &#8220;whatever&#8221; portion of the field names that changes with each developer&#8217;s unique way of bundling up the data to send into the notice process.</p>
<p>So, from the template designer&#8217;s perspective, it seems rather confusing that you have to code <strong>$data.user.id</strong> in one instance and <strong>$data.request.remoteUser</strong> in another when the result turns out to be the same value. Shouldn&#8217;t you guys all get together and come up with a consistent approach or a standard as to how you are going to do this?</p>
<p>Well, yes and no &#8230;</p>
<p>Consistency is good, but flexibility is good, too. I don&#8217;t really want to force people into doing things the way that I do them. The whole point was to create something that everyone could use in the way that best fit their needs. Still, it would be nice, for a lot of different reasons, if everything were approached in some kind of consistent maner.</p>
<p>So, I had this idea.</p>
<p>What if we created some kind of static utility or method call that included as much &#8220;standard&#8221; stuff as possible, yet still left room for individual elements to be added into the mix as well. Something like:</p>
<pre>noticeData = notifier.getStandardNoticeData(request, response);</pre>
<p>This would return a Map with some standard elements already populated in a consistent format, and then you could add other data to the map as well for your own unique purposes; however, the standard stuff would always be the same if you used this method. And if you didn&#8217;t want to for some reason, you could go without. That would retain the original flexibility, and yet provide some common framework for common elements such as the current date, the current user, incoming form fields, the request object, the session object, and any number of other elements commonly used in web applications. The best of both worlds: consistency right there for easy picking if you want it, and the flexibility to ignore that for those that don&#8217;t.</p>
<p>That&#8217;s the theory, anyway. Now I just have to code it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2009/04/notification-service-a-little-minor-enhancement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Look-up Tables: LookupTableJsonServlet revisited</title>
		<link>http://blog.restafarian.org/2009/03/look-up-tables-lookuptablejsonservlet-revisited/</link>
		<comments>http://blog.restafarian.org/2009/03/look-up-tables-lookuptablejsonservlet-revisited/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 13:59:56 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[look-up tables]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[servlet]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=450</guid>
		<description><![CDATA[I know that I said that we would work on the client-side modifications to the look-up table definitions edit next, but after looking over the changes that were going to be needed, I came across a little something that will need to be addressed first. One of the features of the Look-up Table service is [...]]]></description>
			<content:encoded><![CDATA[<p>I know that <a title="Look-up Tables: Look-up table entry list" href="http://blog.restafarian.org/2009/03/look-up-tables-look-up-table-entry-list-cont/" target="_self">I said that we would work on the client-side modifications</a> to the look-up table definitions edit next, but after looking over the changes that were going to be needed, I came across a little something that will need to be addressed first.</p>
<p>One of the features of the Look-up Table service is that you can define a property in a look-up table that another look-up table defined as its source. You can read more about this concept <a title="Look-up Tables: Sourced properties" href="http://blog.restafarian.org/2008/08/look-up-tables-sourced-properties/" target="_self">here</a>. Now that we have introduced the idea of the context, though, we have a little issue that needs to be resolved regarding the possible sources for a look-up table property.</p>
<p>In the current system, the drop-down list of choices for a property&#8217;s source comes from the list of all look-up tables. Now that look-up tables have been separated into specific contexts, we need to decide if the list of potential sources comes from all tables (in which case the &#8220;source&#8221; will have to be expressed as &lt;context&gt;/&lt;tableName&gt;), or if the potential sources should be limited to just those look-up tables in the specific context of which this particular table is a member.</p>
<p>On top of the philosophical decision, is of course, the technical ramifications. When we <a title="Look-up Tables: Even more servlet refactoring" href="http://blog.restafarian.org/2009/02/look-up-tables-even-more-servlet-refactoring/" target="_self">modified the LookupTableJsonServlet</a> to accomodate the new context, we assumed that the context would be passed as a parameter, limiting the servlet&#8217;s output to just those tables in the specified context. If we elect to allow sourcing from outside the current context, this will obviously need to change. On the other hand, the current design of the <a title="http://www.restafarian.org/examples/lookup6/lookup_table_edit_example.html?table=dataType" href="http://www.restafarian.org/examples/lookup6/lookup_table_edit_example.html?table=dataType" target="_blank">example table definition edit page</a> does not include the context as a parameter in the existing script tag that pulls in the JSON object produced by this servlet. Since the context is now passed to this page via a query string parameter, the query string will first have to be parsed and the context value extracted before this JSON object can be retrieved using the context. This will require a change to the way in which this script is brought into the page.</p>
<p>At this point, I think the safest thing to do would be to expand the output of the LookupTableJsonServlet to potentially include all tables from all concepts, with the option of limiting the results by passing in a specific context. This way, this servlet will support both approaches, and we can then elect to go either way on the client side.</p>
<p>We better do that first, before we take on the actual edit page changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2009/03/look-up-tables-lookuptablejsonservlet-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Look-up Tables: Refactoring the servlets</title>
		<link>http://blog.restafarian.org/2009/02/look-up-tables-refactoring-the-servlets/</link>
		<comments>http://blog.restafarian.org/2009/02/look-up-tables-refactoring-the-servlets/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 00:53:38 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[look-up tables]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=412</guid>
		<description><![CDATA[Now that we have completed the modifications to the core project and rebuilt (finally!) the project web site, it&#8217;s time to move on to the core web project, and make the corresponding changes there to accomodate the new context concept. The first things we&#8217;ll need to do is refactor all of the serlvets. To start [...]]]></description>
			<content:encoded><![CDATA[<p>Now that we have <a title="http://blog.restafarian.org/2009/02/look-up-tables-build-core-project/" href="http://blog.restafarian.org/2009/02/look-up-tables-build-core-project/" target="_self">completed the modifications to the core project</a> and <a title="Look-up Tables: Core project web site" href="http://blog.restafarian.org/2009/02/look-up-tables-core-project-web-site/" target="_self">rebuilt (finally!) the project web site</a>, it&#8217;s time to move on to the <a title="http://www.restafarian.org/projects/core-web/" href="http://www.restafarian.org/projects/core-web/" target="_blank">core web project</a>, and make the corresponding changes there to accomodate the new context concept.</p>
<p>The first things we&#8217;ll need to do is refactor all of the serlvets. To start with, we&#8217;ll need to come up with a new strategy for all of the URLs. When we <a title="Next Up: Universal look-up tables" href="http://blog.restafarian.org/2008/06/next-up-universal-look-up-tables/" target="_self">first introduced the idea of the Look-up Tables</a>, we envisioned the following URL structure:</p>
<pre>http://&lt;serverName&gt;/&lt;contextRoot&gt;/tbl/&lt;tableId&gt;

http://&lt;serverName&gt;/&lt;contextRoot&gt;/tbl/&lt;tableId&gt;/&lt;entryId&gt;</pre>
<p>The eventual structure that we ended up with turned out to be relatively close to that with some minor improvements:</p>
<pre>All tables:

http://&lt;serverName&gt;/&lt;contextRoot&gt;/table

One table:

http://&lt;serverName&gt;/&lt;contextRoot&gt;/table/&lt;tableId&gt;

All entries for a table:

http://&lt;serverName&gt;/&lt;contextRoot&gt;/entry/&lt;tableId&gt;

One table entry:

http://&lt;serverName&gt;/&lt;contextRoot&gt;/entry/&lt;tableId&gt;/&lt;entryId&gt;</pre>
<p>Now that we&#8217;ve added the context, we&#8217;re going to have to work that into the URL structure as well:</p>
<pre>All tables:

http://&lt;serverName&gt;/&lt;contextRoot&gt;/table

All tables in a specific context:

http://&lt;serverName&gt;/&lt;contextRoot&gt;/table/&lt;context&gt;

One table:

http://&lt;serverName&gt;/&lt;contextRoot&gt;/table/&lt;context&gt;/&lt;tableId&gt;

All entries for a table:

http://&lt;serverName&gt;/&lt;contextRoot&gt;/entry/&lt;context&gt;/&lt;tableId&gt;

One table entry:

http://&lt;serverName&gt;/&lt;contextRoot&gt;/entry/&lt;context&gt;/&lt;tableId&gt;/&lt;entryId&gt;</pre>
<p>&#8230; which means that we have some changes to make to all of the servlets in the Look-up Table subsystem. Time to get back to work!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2009/02/look-up-tables-refactoring-the-servlets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Look-up Tables revisited</title>
		<link>http://blog.restafarian.org/2009/01/look-up-tables-revisited/</link>
		<comments>http://blog.restafarian.org/2009/01/look-up-tables-revisited/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 18:26:41 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[look-up tables]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=388</guid>
		<description><![CDATA[Once I started thinking about making a stand-alone demo release that you could just download, unzip, and launch, I had this urge to go back and clean up all of the little odds and ends that I had left undone in the name of pushing forward and getting to &#8220;done&#8221; on specific tasks. The basic [...]]]></description>
			<content:encoded><![CDATA[<p>Once I started <a title="Notification Service: Now what (again!)?" href="http://blog.restafarian.org/2008/12/notification-service-now-what-again/" target="_self">thinking about making a stand-alone demo release</a> that you could just download, unzip, and launch, I had this urge to go back and clean up all of the little odds and ends that I had left undone in the name of pushing forward and getting to &#8220;done&#8221; on specific tasks. The basic thought process there was that, if I was going to put together a demo file that was easy to get up and running quickly, I didn&#8217;t really want it to be filled with a bunch of unfinished or passed over features. Of course, the flip side of that is that you can&#8217;t do everything that you want to do, and if you wait until you do, then you won&#8217;t ever release anything, but still &#8230;</p>
<p>Anyway, one of the main things that I want to showcase in the demo system is the <a title="Notification Service: Overview" href="http://blog.restafarian.org/2008/10/notification-service-overview/" target="_self">Notification Service</a>, mainly because I think it has a lot of potential uses in a variety of different areas. A major component of that service is the capability of creating and maintaining the templates for the notices that go out, but one thing that I never really finished was the <a title="Notification Service: NoticeTemplate edit" href="http://blog.restafarian.org/2008/11/notification-service-noticetemplate-edit/" target="_self">template editor</a>. Yes, <a title="http://www.restafarian.org/examples/notify2/notice_template_edit_example.html?context=global&amp;name=passwordchanged" href="http://www.restafarian.org/examples/notify2/notice_template_edit_example.html?context=global&amp;name=passwordchanged" target="_blank">it works</a>, but there are a number of things that I wanted to add, including the addition of a Rich Text Editor, that I just never went back a completed. One thing that I thought would be pretty simple to go ahead and do was to use the <a title="Next Up: Universal look-up tables" href="http://blog.restafarian.org/2008/06/next-up-universal-look-up-tables/" target="_self">Look-up Table service</a> to replace the open entry text boxes for both the Content Type field and the Delivery Method field with drop-down select/option controls for the specific valid values. That seemed like a relatively easy thing to do, but it got me thinking &#8230;</p>
<p>The Look-up Table service is very nice, and it creates an easy way to set up a quick drop-down or pop-up pick list of valid values for all kinds of things, but not all lists of valid values are the same. Some of them, such a list of valid US State postal codes or a list of the days of the week or months of the year, are universal, and are the same for all applications. But there are many others that are very application-specific, and really have no place in a shared repository of look-up tables. The two that I was thinking of creating, Content Type and Delivery Method, were quite specific to the Notification Service, and not really relevant to any other application. Which got me thinking &#8230;</p>
<p>I need to add another level of &#8220;qualifier&#8221; to the whole Look-up Table concept. In the <a title="Next up: the Authorization service" href="http://blog.restafarian.org/2008/03/next-up-the-authorization-service/" target="_self">Authorization Service</a>, we utilized the idea of a &#8220;context&#8221; to separate authorizations for one application, or functional area, from another. We could adopt the same strategy with the Look-up Table service, and possibly even use the same values. In fact, we could use the Look-up Table service to create a Context table of valid contexts, which could then be used by both the Authorization Service and the Look-up Table service. We could create a &#8220;shared&#8221; context for common tables, and then a &#8220;notification&#8221; context for the two tables that I wanted to create for the Notification Service. And, of course, all of that could be pre-loaded into the demo system database so it was all there to see when you brought up the demo system.</p>
<p>Of course, to do that would involve refactoring most, if not all, of the Look-up Table software, but I just got through a <a title="DAO Refactoring: OK, that’s the end of that!" href="DAO Refactoring: http://blog.restafarian.org/2008/12/dao-refactoring-ok-thats-the-end-of-that/" target="_self">massive refactoring project</a> of all DAO components, so it&#8217;s not like I haven&#8217;t done something like that before. It&#8217;s a lot of work, but one way to get a lot of work done is to get started doing it.</p>
<p>So, let&#8217;s get started!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2009/01/look-up-tables-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notification Service: To wait or not to wait &#8230;</title>
		<link>http://blog.restafarian.org/2008/11/notification-service-to-wait-or-not-to-wait/</link>
		<comments>http://blog.restafarian.org/2008/11/notification-service-to-wait-or-not-to-wait/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 03:51:48 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[Notification Service]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=319</guid>
		<description><![CDATA[I&#8217;ve been experimenting with different approaches to various issues related to the Notification Service, and one particular issue keeps coming up time and again, and I keep going back and forth as to which is the better approach. When a request comes in to send off x number of notifications, I can either 1) fulfill [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been experimenting with different approaches to various issues related to the Notification Service, and one particular issue keeps coming up time and again, and I keep going back and forth as to which is the better approach. When a request comes in to send off x number of notifications, I can either 1) fulfill the request in the current thread and then return to the caller upon successful completion of the process or 2) launch a second thread to asynchronously send out the notifications and then return to the caller without waiting for the outcome of that new, independent process.</p>
<p>The obvious benefit of the second alternative is performance, particularly in cases where there are a number of messages to deliver and/or large blocks of text into which variable data must be injected. Depending on how much work you have to go through to set up the process to be launched in its own thread and how much work must be done once the new thread is released, this performance improvement could be significant, or it could be inconsequential. I am pretty sure, though, that there are definitely scenarios in which it would be quite significant.</p>
<p>The down side, of course, is that you have no way of knowing how successful that process turns out once you release it to run on its own. Sure, there are various ways to have it report back to someone, somewhere, but by that time, the original thread may be long gone and the user moved on to something else. For all intents and purposes, once you spin off a thread to do this kind of work, it&#8217;s gone from view. So, the process has to account for that, and have some way to recover in the event of some kind of failure.</p>
<p>One other thing that will impact performance is the point at which you resolve variable data in the message. If all recipients are to receive the exact same message, then you can resolve the message once at the onset of the process, and then loop through the recipient list and send each recipient the resolved message. On the other hand, if each recipient is to receive a message customized just for them, with data for variable replacement coming from the individual recipient objects, then the message resolution must occur inside the loop, once for each recipient. With a large list of recipients, this second approach will be considerably more time consuming than the first. However, it is the only way for each recipient to receive personalized messages directed specifically to them.</p>
<p>So, for personalized messages to a large list of recipients, launching a separate thread is about the only way to do this and still respond back the user in any kind of timely manner. I would imagine, though, that the vast majority of the uses of the Notification Service will be for a single recipient, and spinning off a separate thread would probably be more trouble than it would be worth.</p>
<p>Of course, I guess you could set the service up in such a way that either approach would be an option, and then you wouldn&#8217;t have to choose one over the other until run time. That approach certainly avoids the decision, but at the cost of additional work to code for both alternatives. I guess that makes the decision one of three choices: do one, do the other, or do both!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2008/11/notification-service-to-wait-or-not-to-wait/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notification Service: Overview</title>
		<link>http://blog.restafarian.org/2008/10/notification-service-overview/</link>
		<comments>http://blog.restafarian.org/2008/10/notification-service-overview/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 01:40:05 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[Notification Service]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=270</guid>
		<description><![CDATA[Even though we started out this series on the Notification Service with a little chunk of code, before we get too far down that road, I wanted to step back a little bit and review the basic concept. Although I imagine that this whole process could potentially grow to accomodate many features and functions, right [...]]]></description>
			<content:encoded><![CDATA[<p>Even though we started out this series on the Notification Service with a little chunk of code, before we get too far down that road, I wanted to step back a little bit and review the basic concept. Although I imagine that this whole process could potentially grow to accomodate many features and functions, right at the moment I am going to attempt to focus on some basic functionality, just to get the ball rolling.</p>
<p>The basic premise of the service is simply this: given a boilerplate template for a message, an object containing data to be used to resolve variables in the template, a collection containing recipient data, which could also be used to resolve variables in the template, and few other, minor tidbits of information such as the content type, delivery method, and name of the property containing the recipient&#8217;s address within the objects stored in the collection of recipients, the service will loop through the recipients, resolve the variables in the template for each recipient, and deliver the notice via the specified delivery method. Collectively, I call all of these items needed to carry out the work of the service the <em>Notification Request</em>, and I envision the entire process to look something like this:</p>
<p><a href="http://blog.restafarian.org/wp-content/uploads/2008/10/notification.jpg"><img class="aligncenter size-full wp-image-271" title="notification" src="http://blog.restafarian.org/wp-content/uploads/2008/10/notification.jpg" alt="" width="480" height="380" /></a></p>
<p>At some point in the future, I envision the potential for several independent delivery methods such as e-mail, instant message, text paging, <a title="http://twitter.com/" href="http://twitter.com/" target="_blank">Tweets</a>, fax, and maybe even hard-copy to specified printers or sent to some service that prints out the message and drops into an envelope and sends it via snail mail. There are all kinds of possibilities there, but to start with, I am just going to focus on e-mail. I am going to attempt to do it in a way, though, that allows new delivery methods to be added at will without having to do much in the way of overhauling the existing code base.</p>
<p>Right now, I don&#8217;t see this particularly as a <a title="http://www.xfront.com/REST-Web-Services.html" href="http://www.xfront.com/REST-Web-Services.html" target="_blank">REST</a> service, although some kind of REST wrapper could cetainly be added at a later time. At this point, though, I am looking more at a simple object that could be instantiated and configured via <a title="http://www.springframework.org/" href="http://www.springframework.org/" target="_blank">Spring</a>, upon which you would simply invoke a single method such as notifier.sendNotification(notificationRequest) or notificationRequest.send(). Under the hood, of course, there would be a number of layers of subordinate services (such as the <a title="Notification Service: Simple Velocity service" href="http://blog.restafarian.org/2008/10/notification-service-simple-velocity-service/" target="_self">SimpleVelocityService</a>) to perform such functions as retrieving notice templates or delivering messages for a specific delivery method. From the outside, though, I hope to make it a rather simple, basic API to get the job done.</p>
<p>As far as the templates are concerned, I do see the need for the standard REST service to maintain the templates, incorporating all of the standard CRUD operations so that templates can be created and kept up to date. I&#8217;d like to set that up in such a way that you can drop in the maintenance widgets onto your own plain HTML pages in much the same as was done for the maintenance of the authorities in the <a title="The Authorization Service: All wrapped up!" href="http://blog.restafarian.org/2008/03/the-authorization-service-all-wrapped-up/" target="_self">Authorization Service</a>. I would also like to organize the templates in some way so that you could have a central repository of templates that included both shared templates and templates specific to certain applications or departments, with of course, the option to use your own repository as well.</p>
<p>I think I will actually start with the templates themselves, and go ahead and start to build the Notice Template maintenance process as a separate project. The DAOs and the data managers and the associated unit tests will all be pretty much clones of things that we have done before, so that will be a nice, familiar place to get the ball rolling. Once that is in place, then we branch out to the features and functions more specific to the particular goals of this particular project.</p>
<p>That&#8217;s the view at 30,000 ft, anyway. Next time, I think we will create a NoticeTemplate bean, and then start tossing together all of the parts to connect that to a back-end database and some front-end data maintenance processess. These things have a way of evolving over time, so when all is said and done, the final result may not look anything like the picture above, but that&#8217;s the vision that we will set out with, anyway!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2008/10/notification-service-overview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Look-up Tables: Data type look-up table</title>
		<link>http://blog.restafarian.org/2008/08/look-up-tables-data-type-look-up-table/</link>
		<comments>http://blog.restafarian.org/2008/08/look-up-tables-data-type-look-up-table/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 17:25:39 +0000</pubDate>
		<dc:creator>Restamon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[drop down]]></category>
		<category><![CDATA[look-up tables]]></category>
		<category><![CDATA[pick list]]></category>

		<guid isPermaLink="false">http://blog.restafarian.org/?p=210</guid>
		<description><![CDATA[I decided to call my look-up table of property types Data Type, because I&#8217;m starting to think that it will have broader application than just its current use in the look-up table subsystem. On a number of occasions, I have implemented the concept of data &#8220;attributes&#8221; that can be customized for specific purposes, and I [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to call my <a title="Look-up Tables: More on property types" href="http://blog.restafarian.org/2008/08/look-up-tables-more-on-property-types/" target="_self">look-up table of property types</a> <strong>Data Type</strong>, because I&#8217;m starting to think that it will have broader application than just its current use in the look-up table subsystem. On a number of occasions, I have implemented the concept of data &#8220;attributes&#8221; that can be customized for specific purposes, and I can see using this table, or something like it, to define attribute &#8220;types&#8221; in the same manner as we are defining property &#8220;types&#8221; here. For example, you can have a generic user system that can be extended by using sites with custom-defined user &#8220;attributes&#8221;. A table such as this one would be a good addition to such a strategy, as you could establish the &#8220;type&#8221; of attribute instead of just using a generic text field.</p>
<p>Since we are using the look-up table subsystem to develop a portion of the look-up table subsystem, it gets a little confusing at times, but the resulting &#8220;virtual&#8221; tables that are created are pretty much equivalent in concept to any other data table &#8212; they just happen to reside in a single, generic physical table in the database. The <strong>Data Type</strong> table is no exception, and like many look-up tables, it has some additional data in it beyond the basic labels and values normally found in a look-up table. Here are the additional properties that I have defined so far:</p>
<dl>
<dt><strong>maximumSize</strong> <em>(Decimal)</em></dt>
<dd>Eventually, this value will be used to set the size of certain text input fields, and will also be used in user input validation. A &#8220;size&#8221; is not really appropriate for all data types. For data types where size is not a useful data point, this property should be set to zero (0).
</dd>
<dt></dt>
<dt><strong>sourceUsed</strong> <em>(Boolean)</em></dt>
<dd>The idea of &#8220;source&#8221; refers to having a fixed list of valid values. At this point, the only &#8220;source&#8221; available for such values would be another look-up table. Eventually, I can see including other, outside sources as well, but I haven&#8217;t even gotten the internal look-up table source working at this point, so I&#8217;m not quite ready to get that ambitious.
</dd>
<dt><strong>inputControl</strong> <em>(Text)</em></dt>
<dd>This is the first &#8220;code snippet&#8221; text block, and unlike all of the others, the language for this one is HTML. The concept here is that you provide the basic HTML template for the input control for this type of data, with some placeholders that will be resolved at runtime. So far, the only placeholder that I have programmed is the tagName, which should be coded as {0} &#8230; eventually, I plan to have a few others, particularly the &#8220;size&#8221; attribute, which will probably be coded as {1}, and then {2} will end being something else and so on &#8230; somewhere, there will have to be list of all of these, but for now, it&#8217;s just the tagName, so we&#8217;re pretty safe.
</dd>
<dt><strong>populationScript</strong> <em>(Text)</em></dt>
<dd>This is another &#8220;code snippet&#8221; text block. The language for this one, and all of those that follow, is Javascript. The concept here is that you are provided with a populated field called &#8220;value&#8221; and you need to provide the code to take that value and place in within your input control (see above) for user editing.
</dd>
<dt><strong>validationScript</strong> <em>(Text)</em>
</dt>
<dd>The script that you place here actually has two jobs: 1) validate the user input, and move the data out of your control and back into the field called &#8220;value&#8221;. Aslo, if you need to do any data conversion because you store the field differently than you display it, then this would be the place for that as well.
</dd>
<dt><strong>formatScript</strong> <em>(Text)</em></dt>
<dd>This one I am not using yet, but the thought here is that, for viewing purposes (not editing) you might want to provide some code to format the data to make it look pretty for some reason. Again, I have not done anything with this as yet, but that&#8217;s the theory on its purpose anyway.
</dd>
</dl>
<p>When all is said and done, you should be able to use the look-up table subsystem to list out the contents of the Data Type table and then add any new data types at will and have them start showing up as options for additional properties in any table definition. The Data Type table itself actually used three different types of properties (Decimal, Boolean, and Text), so the Data Type table definition is an example of how data types are used in the system.</p>
<p>Right now, I just have <a title="http://www.restafarian.org/examples/lookup6/lookup_table_entry_list_example.html?table=dataType" href="http://www.restafarian.org/examples/lookup6/lookup_table_entry_list_example.html?table=dataType" target="_blank">a handful of data types defined</a>, but my thought is that I will just define more as I need them. If all works as it should, that should be a simple as defining a new entry in the table. If I&#8217;ve done the job right, there should be no coding or development work involved.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.restafarian.org/2008/08/look-up-tables-data-type-look-up-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
