<?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>Kapil &#124; Scratch Pad &#124; Java &#124; Architecture &#124; Design &#124; Open Source</title>
	<atom:link href="http://scratchpad101.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://scratchpad101.com</link>
	<description>Kapil &#124; Scratch Pad &#124; Java &#124; Architecture &#124; Design &#124; Open Source</description>
	<lastBuildDate>Mon, 30 Jan 2012 15:08:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Modeling Content in CQ54</title>
		<link>http://scratchpad101.com/2012/01/30/modeling-content-cq54/</link>
		<comments>http://scratchpad101.com/2012/01/30/modeling-content-cq54/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 15:00:41 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[Adobe CQ]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[content-modeling]]></category>
		<category><![CDATA[cq54]]></category>
		<category><![CDATA[crx]]></category>
		<category><![CDATA[designa]]></category>
		<category><![CDATA[modeling]]></category>
		<category><![CDATA[rchitecture]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=172</guid>
		<description><![CDATA[CQ54 is not a a typical RDBMS where I can model a set of relationships in table and soon a pretty picture starts to present itself. CQ54 stores everything in its content repository (CRX) as nodes which follow an entirely different data model i.e. Hierarchical Structure. My experience with hierarchical databases has been with day [...]]]></description>
			<content:encoded><![CDATA[<p>CQ54 is not a a typical RDBMS where I can model a set of relationships in table and soon a pretty picture starts to present itself. CQ54 stores everything in its content repository (CRX) as nodes which follow an entirely different data model i.e. Hierarchical Structure. My experience with hierarchical databases has been with day to day applications like MS Windows File Explorer, outlook Folder structure and in application development directory services like LDAP. So, I am going to start off by listing down what I understand of hierarchical database before I ponder down to my set of questions.</p>
<p>A hierarchical database model means that my data is arranged into a structure that is similar to tree (organization chart). This resides on the premise of a 1:N relationship where a child can have only one parent, where in a parent can have multiple child records. It has characteristics that differ a lot from a relational database. To list a few:</p>
<p>1. Every node is a record<br />
2. Data is stored as properties on the node<br />
3. Every node can be of a different data type &#8211; a hierarchical model does not mandate to have same record types under a same parent<br />
4. A child node can be a child to one and only one parent</p>
<p>Hierarchical databases have their advantages:</p>
<p><strong>Performance</strong>: Navigating records in a hierarchical model is faster because the references are basically pointers to the nodes/records directly. I don&#8217;t have to search in a index or a set of indexes. This however, is true in a case only when my data model does not have a lot of references. If i am working off with a content-model that includes multi-level references, performance will head south<br />
<strong>Easy to understand</strong>: It is a simple hierarchy; and it represents something that is &#8220;non-technical&#8221;. It naturally represents what exists.<br />
And Hierarchical databases have their limitations:</p>
<p><strong>Unable to draw complex relationships between various child nodes</strong> &#8211; Given the premise that a child node will have only one parent, they are identified only by their parents. We have the capability like XPath to navigate directly to a node, which may be faster. If we do not know the exact path, we will have to navigate the tree (up to a parent, maybe the root) and then down to all nodes before we find what we are looking for. Some questions that I am asking myself:<br />
1. What qualifies as a reference for an object?<br />
2. Should speed at which the data can be fetched a driver to defining a reference?<br />
3. What are the best practices that I should be aware off, when I am modeling my domain?<br />
4. When do i decide I need a network model instead of hierarchical model?<br />
<strong>Difficult of maintain</strong> &#8211; hierarchical models also mean that I do not have a command like ALTER TABLE. This essentially means then if I later decide to add another property to a specific node type I will have to write code to update all the nodes<br />
1. Is there a way where I can update a node-type thus updating all the objects which are of that node type?<br />
2. Is there a way to avoid such situations (apart from saying that lets get it right in Release 1.0 and pray to God client will not ask for a change request <img src='http://scratchpad101.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )<br />
<strong>Lack of Flexibility</strong> &#8211; In this article, Scott Ambler quotes &#8211; &#8220;Hierarchical databases fell out of favor with the advent of relational databases due to their lack of flexibility because it wouldn’t easily support data access outside the original design of the data structure. For example, in the customer-order schema you could only access an order through a customer, you couldn’t easily find all the orders that included the sale of a widget because the schema isn’t designed to all that.&#8221;. This is a typical case of where reporting is a must and it might be in many systems.<br />
1. Are there other scenarios?<br />
With all the context set of Hierarchical, it is now important we look at CQ54&#8242;s content repository &#8211; CRX. While CRX is a hierarchical repository it should not be confused with a hierarchical database. CRX provides us with JCR node types which allow us to force structure. We also have the capability of creating custom nodes, but should do it with care. The principle is not to go overboard with structure.</p>
<p>Question remains &#8211; &#8220;how do I manage content in CQ54&#8243;. I do not have a &#8220;go-to&#8221; answer, but what I have described below is how I am going to think when I start the process.</p>
<p><strong>Content modeling</strong>: Look at the requirements i.e. wireframes, creative design assets and identify various content types, structures and relationships between content types. We can take the object-oriented approach and define everything as an object or keep similar content types together. There are several things that should be considered when taking one approach over the other:</p>
<p><strong>What is the business process for crating an object type. Do the content types follow same workflow?</strong><br />
1. Steps that are required to activate a content. An article, a blog, a discussion forum entry may have the same process flow of an author and a reviewer then there is a case of having a single abstract content type<br />
2. However, if an article needs a legal review and can be used in several other business process than just a simple article we may want to bring article out as its own content type<br />
<strong>Reuse</strong><br />
1. What kind properties do they share<br />
2. Modeling content for an education system where we have content types like a college or a school where we see a lot of similarities there is a case we can build on creating an abstract content<br />
<strong>How does the content author wants to look at the content</strong><br />
1. If we have a set of users who want to manage their content as structured content like books, movies etc we should look to provide those content types very specifically<br />
2. In another scenario if we have authors who do not worry a lot about specific objects i.e. Page-centric content creation then we can decide to club content types together</p>
<p>&nbsp;</p>
<p><strong>Managing Relationships</strong>: In CQ, given it has a hierarchy based data storage model which complies with JCR specifications, we do not have a way to create strict rule-based relationships. We can create relationships using one of the following ways:</p>
<p><strong>Path based references</strong>: We can do this by creating properties on objects that hold a &#8220;path&#8221; or a &#8220;list of path&#8221; to which the content has relationships with<br />
1. They are semantic<br />
2. Not bound to an &#8220;obscure IDs&#8221;<br />
3. Do not enforce integrity constraints which may create troubles in extensibility later<br />
4. Being REST-ful they allow us to navigate directly to the node, thus making navigations very quick<br />
5. Being REST-ful, they allow author to visualize their content relationships well thus providing them a business view of the content<br />
<strong>Taxonomy based references</strong>: CQ uses tags to represent a taxonomy. However,  we can not extend tags to hold various profile information. So, you will need to have a mapping system that maps a tag to a content in CRX<br />
1. Taxonomy is the foundation on which the IA stands. Taxonomy allows us a classification system and how the users will view the content on the site.<br />
2. Allow us to clearly identify where in the system the content type resides<br />
3. Is a conceptual framework allowing customers and their customer to locate what they need easily<br />
4. It is hierarchical<br />
<strong>Relational Database</strong><br />
1. Can be used in case we reach a point where relationships are too complex<br />
2. Transactional Data should be kept out of CMS and placed in a relational database (or similar)<br />
3. If we do not have to manage the lifecycle of the content<br />
4. Please note that this  will make architecture complex, but if this is needed that it is</p>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2012/01/30/modeling-content-cq54/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Language of Risk « The IT Risk Manager</title>
		<link>http://scratchpad101.com/2012/01/13/the-language-of-risk-the-it-risk-manager/</link>
		<comments>http://scratchpad101.com/2012/01/13/the-language-of-risk-the-it-risk-manager/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 06:22:14 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[Desciplines]]></category>
		<category><![CDATA[Risks]]></category>
		<category><![CDATA[discipline]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[risk]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=168</guid>
		<description><![CDATA[The language is important because it helps you think about the problem in the right way. This statement stuck a chord reminding me of an instance not so long ago . She asked me &#8211; &#8220;why did my project had just a couple of risks?&#8221; . She went on to probe us (my PM and [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>The language is important because it helps you think about the problem in the right way.</p></blockquote>
<p>This statement stuck a chord reminding me of an instance not so long ago . She asked me &#8211; &#8220;why did my project had just a couple of risks?&#8221; . She went on to probe us (my PM and me) to understand if we were not thinking of the risk.</p>
<p>At that time, I did not answer her in the way the Author summarizes it. We presumed that we had a functional scope documented and hence the risk of not being able to deliver what was required did not exist.</p>
<p>via <a href="http://theitriskmanager.wordpress.com/2011/12/12/the-language-of-risk/">The Language of Risk « The IT Risk Manager</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2012/01/13/the-language-of-risk-the-it-risk-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write Through Cache</title>
		<link>http://scratchpad101.com/2012/01/11/write-through-cache/</link>
		<comments>http://scratchpad101.com/2012/01/11/write-through-cache/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 09:30:44 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[architetcure]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[write-through]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=158</guid>
		<description><![CDATA[I was a young budding developers when I was first introduced to the concept of Cache. My Senior Architect then told me Cache is a component that will magically store data so that future requests of that same data will not be to the Remote Server, and hence it will improve the performance of our [...]]]></description>
			<content:encoded><![CDATA[<p>I was a young budding developers when I was first introduced to the concept of Cache. My Senior Architect then told me</p>
<blockquote><p>Cache is a component that will magically store data so that future requests of that same data will not be to the Remote Server, and hence it will improve the performance of our application significantly faster</p></blockquote>
<p>We were working on a website which was to integrate with an existing application through the use of APIs and for purposes of closer integration we had decided to store the data in form of XML as artifacts in this tool as tracker items &#8211; no RDBMS. It was like running two applications joint at the hip.</p>
<p>I had gathered enormous experience working with SourceForge platform APIs as I had integrated them with Ms-Excel and now we were going to build an entire application on <a title="ALM" href="http://en.wikipedia.org/wiki/Application_lifecycle_management">ALM</a> space using the same APIs. Our biggest challenge was going to be performance because of the use of APIs against a remote server sitting in a different geography. And Cache was going to be instrumental in helping us solve that problem.</p>
<p>We had just decided to implement Write-through cache that helped us build a system which was significantly faster that anyone could have thought about. And since then this is one pattern that I have come to use (if possible) whenever I am working with diversified systems. Surprisingly, the percentage of people who have used cache have never heard of this pattern of cache implementation when the underlying issues with the systems can be solved using this pattern (I am still mystified as to why not?).</p>
<p>Before we dig deep, I want to run through some definitions that we are going to use during the course of this article:</p>
<ul>
<li><strong>Cache hit</strong> refers to a request to the data and finding it in the cache</li>
<li><strong>Cache miss</strong> refers to a request to the data and not finding it in the cache</li>
<li><strong>Dirty</strong> refers to a cached data if it has not the same as the original data</li>
<li><strong>Lazy</strong> refers to an action if it not performed real time, but only when it is required</li>
</ul>
<h3></h3>
<p>In its simplest form, a cache implementation is going to something similar to the image below.</p>
<div id="attachment_162" class="wp-caption alignright" style="width: 205px"><a href="http://scratchpad101.com/wp-content/uploads/2012/01/Cache-Workflow1.png"><img class="size-medium wp-image-162" title="Cache - Workflow" src="http://scratchpad101.com/wp-content/uploads/2012/01/Cache-Workflow1-195x300.png" alt="Cache - Workflow" width="195" height="300" /></a><p class="wp-caption-text">Cache - Workflow</p></div>
<p>As you can already see that this is just one part of the cache implementation and implementing this workflow alone would mean that once I have a data in the cache it would only always fetch the data from the local cache location and go back to the original data source only if the cache data is <strong>Dirty</strong>. And there are several ways we have to mark the data as dirty &#8211; it can be an action we configure in our system like &#8211; &#8220;If we are update records in the data source, we try to find the key and mark it dirty&#8221;. Another way is to decide a time after which the the cache should be expired automatically.</p>
<p>While, this approach is simple enough, this does presents a unique &#8220;problem&#8221; (and it may not be a problem for everyone). Lets revisit the reason for which we decided to implement cache.</p>
<blockquote><p> Cache is a component that will magically store data so that future requests of that same data will not be to the Remote Server, and hence it will improve the performance of our application significantly faster.</p></blockquote>
<p>This implies that &#8220;Caching is a mechanism that is faster when compared to our data source when it comes to data loading&#8221;. I have observed cache implementations against RDBMS sitting next to a Application Server, which means that loading data from the RDBMS is still faster and hence there is really no need to improvise on the cache flow as defined earlier.</p>
<p>In our case, we were dealing with an external system from where we fetched XML over HTTPS and then converted the XML to an object. This entire process was time consuming &#8211; 3 seconds for one object and there was nothing we could do about reducing the transportation time. It also meant that the classic workflow for us would not work either, especially if a user would update a specific record, and if the cache would be marked dirty, the next request would mean a significant delay time.</p>
<p>We improvised and it was then we used the write-through cache logic that allowed us to manage the data in the cache in real-time with the data-source. The workflow was changed to the one below:</p>
<p><a href="http://scratchpad101.com/wp-content/uploads/2012/01/Cache-write-through.png"><img class="aligncenter size-medium wp-image-164" title="Cache - write through" src="http://scratchpad101.com/wp-content/uploads/2012/01/Cache-write-through-300x180.png" alt="" width="300" height="180" /></a></p>
<p>As simple as it may look it was not so. Lets see first what we did. We added a hook to the code which was required to save the data in the DataSource to do two things:</p>
<ol>
<li>Find the cache entry and mark it dirty if it was a hit and;</li>
<li>Update the cache after a successful update to the data store</li>
</ol>
<p>This allowed us to keep the cache in sync with the DataSource and hence not requiring to spend additional time to load the data back again.</p>
<p>But, as I feel that every solution will bring its challenges, this one had as well especially when we decided to scale and move over to a cluster of application server. This meant that a local cache would simply not work because it was meant that an update to the DataSource meant that the cache on other application servers was out dated and users would not get the most latest data making it impossible to work. We did use version to records to manage the concurrency checks, and not keeping the cache in sync meant that other users will see their updates fail because of that very fail-safe. Eventually, we had to find a cache that can be scaled in a cluster which only made things more complicated.</p>
<h3></h3>
<p>A pattern that I learn in my development adolescence, this had proved to be a powerful technique to build solutions that would work fine in a given scenario.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2012/01/11/write-through-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSGI: The new Toy</title>
		<link>http://scratchpad101.com/2012/01/03/osgi-the-new-toy/</link>
		<comments>http://scratchpad101.com/2012/01/03/osgi-the-new-toy/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 07:26:29 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[adobe-day]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[equinox]]></category>
		<category><![CDATA[felix]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[osgi]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=139</guid>
		<description><![CDATA[I heard about OSGI sometime early last year, but I did not care about it &#8211; it meant start thinking about a new way of development and deployment (thats what I heard from my friends) and I did not want to learn something else when Spring worked great for me. And, my colleagues who spoke [...]]]></description>
			<content:encoded><![CDATA[<p>I heard about <a title="OSGI" href="http://osgi.org" target="_blank">OSGI </a>sometime early last year, but I did not care about it &#8211; it meant start thinking about a new way of development and deployment (thats what I heard from my friends) and I did not want to learn something else when Spring worked great for me. And, my colleagues who spoke about OSGI did not do a good job of advocating OSGI. Last month, I came across <a title="Adobe Day" href="http://day.com" target="_blank">Adobe Day</a> as a potential platform for a project implementation. Day was amongst some of the CMS platforms that I was evaluating, namely &#8211; <a title="SDL Tridion" href="http://www.sdl.com/en/" target="_blank">SDL Tridion</a>, Oracle Stellant and Interwoven.</p>
<p>It was Adobe Day that introduced me to OSGI and during one of the webinars, I was introduced to OSGI using a simple yet powerful graphic (see below).</p>
<div id="attachment_146" class="wp-caption aligncenter" style="width: 310px"><a href="http://scratchpad101.com/2012/01/03/osgi-the-new-toy/osgi-intro/" rel="attachment wp-att-146"><img class="size-medium wp-image-146" title="OSGI - Intro" src="http://scratchpad101.com/wp-content/uploads/2012/01/OSGI-Intro-300x163.png" alt="OSGI - Intro" width="300" height="163" /></a><p class="wp-caption-text">OSGI - Intro</p></div>
<p>And from that moment on, I was simply hooked on. I have been a big fan of Java and its deployment frameworks like Maven &#8211; but essentially using those frameworks and tools also meant that sooner or later I would be dealing with various versions of same library (ehCache, Log4j being the most common) and when I wen to deployment on JBoss or Apache Tomcat, more often than not I would have to tweak my project dependencies to or servers to ensure that those &#8220;dependencies&#8221; are resolved appropriately.</p>
<p>Suddenly, OSGI seems to be the answer to everything (or almost everything). I would be able to create and deploy components and then choose to include them as needed; I did not have to worry about backward compatibility or which service to deploy &#8211; opportunities were endless.</p>
<p>So today, I am going to start off my journey to read more about OSGI and explore some common available containers like <a title="Equinox" href="http://eclipse.org/equinox/" target="_blank">Equinox</a> (used by Eclipse) and <a title="Apache Felix" href="http://felix.apache.org/site/index.html" target="_blank">Apache Felix</a> (used by Adobe Day). And I hope that while I learn more I am able to share my thoughts and some of the best practices around the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2012/01/03/osgi-the-new-toy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup for Success</title>
		<link>http://scratchpad101.com/2011/12/21/setup-for-success/</link>
		<comments>http://scratchpad101.com/2011/12/21/setup-for-success/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 13:57:18 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[principles]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=129</guid>
		<description><![CDATA[Project start is the time when is most critical and single-handedly decide the fate of the project. That is the time when we are preparing ourselves for a journey, and how well prepared decides: When we reach out destination &#8211; on time or late In what condition we reach &#8211; as expected or all burnt [...]]]></description>
			<content:encoded><![CDATA[<p>Project start is the time when is most critical and single-handedly decide the fate of the project. That is the time when we are preparing ourselves for a journey, and how well prepared decides:</p>
<ul>
<li>When we reach out destination &#8211; on time or late</li>
<li>In what condition we reach &#8211; as expected or all burnt up</li>
</ul>
<p>I have done this activity several times in my career, and yet still there is one or the other thing that is left behind. Suddenly, the clients and project managers&nbsp; want to see results. They want to see what is being built and how things are coming up. Suddenly, all the housekeeping tasks become nuisance and nothing is getting accomplished unless there is something to be seen. So, what goes wrong? <strong>Three Things</strong></p>
<p><strong>Planning</strong></p>
<p>It is mandatory to plan for things up ahead. We may not be navigating the ship, but are responsible in many ways that everything that is required for the trip is on board. If the ship is not built to stand the storms, it will crumble; sooner or later. All that is required to be done should be a part of the plan. Once other can visualize the value that the activities will bring, is becomes very easy to negotiate and progress. It becomes simple to justify the load. <strong>Once it in the plan, then no body is worried because it is accounted for.</strong></p>
<p><strong>Execution</strong></p>
<p>No matter what project you are on, things are bound to go bad. On any journey, there are bound to be some bumps. How much they affect your ship or its passengers is again decided how well you are prepared. Prepared not just with the tools, but also with the expertise to execute measures. You will seldom have a A-team, and you need to know who performs how and what scenario. Planning will take you so far. If you do not know how to utilize the resources available to you at that time, you are as good as dead meat. It is panic that causes most troubles. <strong>You have to find ways to be calm especially when there are fires all around you</strong>.</p>
<p><strong>Expectations</strong></p>
<p>Any scenario, we fail to set and manage expectations &#8211; our family, friends, shop keepers, be it anyone. However, some (most of those) do not come back to haunt us. We can bail out easily with minimal impact. All of it happens when we<strong><em> start to assume</em></strong>. And, it happens because we think we have understand what the other person is trying to convey. And, the longer we linger the process of validating our assumption, the bigger impact it has on the outcome. <strong>We should have only one assumption &#8211; &#8220;There are no assumptions&#8221;.</strong></p>
<p>As an Architect, there are certain things I believe have to do. There are several books and handbooks that talk about all that stuff. However, many don&#8217;t have access to them or they have so many things that this topic gets lost somewhere. In my follow-up post, I will publish the activities, with descriptions and their possible exit criterion that all architects should be aware off.</p>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2011/12/21/setup-for-success/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Want to host on Maven Central?</title>
		<link>http://scratchpad101.com/2011/09/08/project-files-maven-central/</link>
		<comments>http://scratchpad101.com/2011/09/08/project-files-maven-central/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 20:07:16 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[Build Management]]></category>
		<category><![CDATA[Build Manager Tools]]></category>
		<category><![CDATA[central repo]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[Open source]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=104</guid>
		<description><![CDATA[<p><img width="300" height="72" src="http://scratchpad101.com/wp-content/uploads/2011/09/67994v1-max-450x450-300x72.png" class="attachment-medium wp-post-image" alt="67994v1-max-450x450" title="67994v1-max-450x450" /></p>Recently, when I decided to make my projects available to the Java Community under Open Source license, I did a lot of things like Hosting my code on Google Code, using Maven to build and test the code and also making sure that I have a project site up and running. However, even after all of this, there was one thing that was missing which was the most essential - "Hosting the project files on a repository so that users who may find these utilities useful may use it".

I found out that Sonatype would allow me to deploy my code to Maven Central Repository. However, after 3 days of trial and error, I have finally been able to release a version of my code to the Central Repo. I am writing this post so that if you ever want to do this, you will not have to go through the same pain as I did.]]></description>
			<content:encoded><![CDATA[<p><img width="300" height="72" src="http://scratchpad101.com/wp-content/uploads/2011/09/67994v1-max-450x450-300x72.png" class="attachment-medium wp-post-image" alt="67994v1-max-450x450" title="67994v1-max-450x450" /></p><p>Recently, when I decided to make my projects available to the Java Community under Open Source license, I did a lit of things like Hosting my code on Google Code, using Maven to build and test the code and also making sure that I have a project site up and running. However, even after all of this, there was one thing that was missing which was the most essential &#8211; &#8220;Hosting the project files on a repository so that users who may find these utilities useful may use it&#8221;.</p>
<p>I started to research on what was possible and after little research I found out that sonatype would allow me to deploy my code to Maven Central Repository. However, after 3 days of trial and error, I have finally been able to release a version of my code to the Central Repo. I am writing this post so that if you ever want to do this, you will not have to go through the same pain as I did.</p>
<h2>Pre-requisites</h2>
<ul>
<li>A domain name which will be your groupId &#8211; I used kapilvirenahuja.com which is used as &#8220;com.kapilvirenahuja&#8221;</li>
<li>A PGP key &#8211; this is a requirement for you to sign your artifacts and upload it to Central. You can refer to the <a title="PGP Key Help" href="https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven">document here</a> for help on how PGP keys can be generated.</li>
<li>Have the username and password of your SVN handy, you will need it while performing builds and releases</li>
</ul>
<h2>&nbsp;</h2>
<h2>Hosting</h2>
<p>The easiest way to upload another project is to use the <a href="http://nexus.sonatype.org/oss-repository-hosting.html">Sonatype OSS Repository</a>, which is an approved repository provided by Sonatype for <em>any</em> OSS Project that want to get their artifacts into Central Repository.</p>
<p>The service is proposed in two variants:</p>
<ul>
<li><a href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide">Maven repository hosting service</a>: You can deploy snapshots, stage releases, and promote your releases so they will be published to Central Repository</li>
<li><a href="https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+Maven+Central">Manual upload of artifacts</a>: The process is mostly automated with turnaround time averaging 1 business day.</li>
</ul>
<p>Follow the steps in the guide which is self-explanatory. After sign-up, when you are creating the issue for a new project, you will need the domain address. If you do not have a domain registered, you will not be able to proceed.</p>
<p>After your account is created, you will receive email notifications that you are good to go. Follow the <a href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide" target="_blank">steps in the link</a> and update your POM as per <a href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-6.CentralSyncRequirement" target="_blank">Step 6</a>. When you are ready, follow instructions in <a href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-7a.DeploySnapshotsandStageReleaseswithMaven" target="_blank">Step#7</a> and you should be able to deploy the code to Snapshot directory. If you get 401 error or &#8220;Authorization failed&#8221;, check for following:</p>
<ul>
<li>The groupId in the POM.XML is the same that you registered for</li>
<li>The Settings.xml has the Nexus username and password. You can run the maven command in -X (debug) mode and see logs to validate the location of the settings.xml file</li>
</ul>
<h2>&nbsp;</h2>
<h2>Release to Central</h2>
<p>Once you have the artifacts on Snapshots repository you are past a major step in the process, but the next one is even bigger. The <a href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-7a.3.StageaRelease" target="_blank">step 7.a.3</a> seems simple but is not that simple especially if you have only used mvn:compile in most cases. Ensure that you follow <a href="http://svnbook.red-bean.com/en/1.5/svn.branchmerge.maint.html#svn.branchmerge.maint.layout" target="_blank">standard directory layout</a> anything else and the process will fail at the last step.</p>
<h3>Step 1</h3>
<p>The First step is to Clean up Release using Maven plugin</p>
<p><code lang="xml">mvn release:clean </code></p>
<p>You will notice that it will be done quickly (apart from the time it takes for maven to download dependencies and plugins).</p>
<h3>&nbsp;</h3>
<h3>Step 2</h3>
<p>Run the following command. You will have to pass the username and password through mvn. The command should be</p>
<p><code lang="xml[lines]">mvn release:prepare &minus;Dusername=username &minus;Dpassword=password</code></p>
<p>It will do the following:</p>
<ul>
<li>Ask for the version number for the current release</li>
<li>Ask for the version of the tag that will be created, should be same as the release number provided above</li>
<li>Ask for the next version of the release &#8211; you can choose to provide a major or minor release.</li>
</ul>
<p>Please be careful when selecting the version numbers, because this process will update the POM files and also the subversion repository by adding new tag and also updating the POM file in the current working location.</p>
<h3>&nbsp;</h3>
<h3>Step 3</h3>
<p><code lang="xml[lines]">mvn release:perform -Dusername=username -Dpassword=password</code></p>
<p>This is a non-intrusive method and will simply upload everything to the repository. If you miss the username and password, the build will fail without any descriptive errors and you will keep wondering what went wrong.</p>
<h3>&nbsp;</h3>
<p>Now follow the remainder of the documents on the Link and enjoy.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://scratchpad101.com/2011/08/30/publishing-project-maven/" target="_blank">Publishing Project using Maven</a> (scratchpad101.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="float: right;" src="http://img.zemanta.com/pixy.gif?x-id=1306bcb7-622f-4ca5-8015-8edddd7e23fa" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2011/09/08/project-files-maven-central/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit Testing: EAMSteps</title>
		<link>http://scratchpad101.com/2011/09/01/unit-testing-with-eamsteps/</link>
		<comments>http://scratchpad101.com/2011/09/01/unit-testing-with-eamsteps/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 20:58:26 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[JUnit]]></category>
		<category><![CDATA[Quality assurance]]></category>
		<category><![CDATA[Test-driven development]]></category>
		<category><![CDATA[TestNG]]></category>
		<category><![CDATA[Unit testing]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=82</guid>
		<description><![CDATA[<p><img width="300" height="175" src="http://scratchpad101.com/wp-content/uploads/2011/09/eamsteps-300x175.png" class="attachment-medium wp-post-image" alt="eamsteps" title="eamsteps" /></p>EAMSteps is a framework that makes Unit Testing easier because of its following principles:
 - External data store for test data like excel spreadsheet
 - Automated assertions using co-related inputs and outputs
 - Minimal lines of code to get started

It all started in 2009, when I decided that in long term I would need to have a framework in place that will help me meet my objectives and I started to look for any existing tools. When I did not find any framework that would help me, I decided that it was time to write one and here after 2 years I have something breathing]]></description>
			<content:encoded><![CDATA[<p><img width="300" height="175" src="http://scratchpad101.com/wp-content/uploads/2011/09/eamsteps-300x175.png" class="attachment-medium wp-post-image" alt="eamsteps" title="eamsteps" /></p><h2>Background</h2>
<p>I came across this <a title="Unit Testing" href="http://java.dzone.com/news/your-code-not-somebody-else%E2%80%99s" target="_blank">article</a> on Dzone, which is just right to set the tone for me to release my latest code, which I find myself to be very proud of. The article speaks about the importance of Unit Testing for developers and how it can save the day for you especially when you are moving into Integration phase of the application. My first encounter with Unit Testing was back in 2004 and it was not just any kind of Unit Testing, it was fully automated Unit Testing using JUnit and NUnit. To add to the mix it was Test Driven Development (TDD). When I started with unit testing it was really frustrating and coding just took time. I knew that my logic was right and yet I had to write test cases. I was going through the motions until after 4 months our Architect told us that we need to a major refactoring. It was then that I saw how useful those test cases were. As we went about changing the implementations of Data Access Objects, we knew all was well once we were able to get the Unit Test cases to pass. And, from that day onwards I was addicted.</p>
<h2>&nbsp;</h2>
<h2>Objectives</h2>
<p>I was working with a client in Agile mode and had a team of 40 developers who cranked 1000s of lines of code (LOC) every day and those LOCs included unit test cases. Given the nature and size of the project it was evident that I wanted TDD model for the project delivery and for the following main reasons:</p>
<ul>
<li>We wanted test cases to double up as requirements;</li>
<li>We wanted our Quality Assurance (QA) team to actively participate in test data formation so that we can reduce the gap between our developers and testers;</li>
<li>We wanted to externalize test data from Unit Test cases so that new data could be added without changing the code (Test code) and different scenarios could be executed based on the test data</li>
</ul>
<h2>&nbsp;</h2>
<h2>Approach &#8211; Where we failed</h2>
<p>We started with the following:</p>
<ul>
<li>TestNG: TestNG had support for data provides which allowed us to pass data during invocation of the test methods</li>
<li>Used XML files for dbSetup and initialization. We created custom classes that allowed us to read data from XML files and run queries against database from within the test cases</li>
<li>JIBX Dataprovider: We used JIBX Data provider to pass the data into TestNG during test execution. This provided expected us to map inputs and output data in XML format</li>
</ul>
<p>However, after just few months, we realized that these choices were not helping us in achieving our goals. The entire setup was too complex and too developer oriented that we could not take it to client. Also, for the QA team it was too much of an overhead to manage all of those files. However, it was too late in the game to change anything and our development team was now getting experienced with the tools and framework. We just did not have time to replace the whole thing at the cost of refactoring and training the team on the new framework. Another problem was that there was no open source and free tool or framework that existed that allowed us to do that (this was back in 2007).</p>
<h2>&nbsp;</h2>
<h2>Journey</h2>
<p>In 2008, I got so fed up with the underlying choices that I decided that this is something I would not use. The only piece I loved was TestNG &#8211; Eclipse integration, Maven integration and Data providers just made life so much easier. JUnit later added the capability for Parametrized Unit Testing, but it had certain shortfalls (I compared the two a while back, you can find the <a title="TestNG vs JUnit" href="http://scrtchpad.wordpress.com/2011/08/07/testng-or-junit/" target="_blank">article here</a>). In 2009, I decided that in long term I would need to have a framework in place that will help me meet my objectives and I started to look for any existing tools. I do not have my research results, but I did not find any framework that allowed me to do what I wanted (at least nothing open source and free). Even today when I search I find the following links. There is not much that they offer. Or maybe I am just not seeing those.</p>
<ul>
<li><a href="http://www.wakaleo.com/component/content/article/241" target="_blank">Approach to use Excel with Parametrised Unit Tesitng with JUnit</a>)</li>
<li><a title="DDSteps" href="http://www.ddsteps.org/" target="_blank">DDSteps</a>: This comes close to what I wanted to do, but this has been built for JUnit which was not choice of unit testing tool. Since then they have come a long way. Their current version of website was non-existent back then and documentation was missing then and it is missing now. Hence, I did not want to reply on something that could be buggy and a project that may be closed</li>
<ul>
<li>The biggest drawback in this framework was that it did not support child objects in Java objects. If my parent Java Object had a child object, I had to load the parent and children java objects separately and then set them manually in my test case</li>
</ul>
</ul>
<p>So I started to visualize what I needed and it was then that I conceived this framework or set of utility classes.</p>
<h2>&nbsp;</h2>
<h2>Concept</h2>
<p>I have tried to keep it very simple and the result is &#8211; EAMSteps:</p>
<ul>
<li>External data store for test data like excel spreadsheet</li>
<li>Automated assertions using co-related inputs and outputs</li>
<li>Minimal lines of code to get started</li>
</ul>
<h2>&nbsp;</h2>
<h2>Current State</h2>
<ul>
<li>I have the basic structure of the project ready and it supports loading the data from Excel sheets only for certain data types;</li>
<li>The files are hosted with Google Code and available here: <a href="https://eamsteps.googlecode.com/svn/trunk/" target="_blank">https://eamsteps.googlecode.com/svn/trunk/</a></li>
<li>Registration with Maven Central is pending; hoping to do that in a few days;</li>
<li>The documentation is only around JavaDocs API and is available <a href="http://projects.scratchpad101.com/iframework/1.0.x/" target="_blank">here</a>;</li>
<li>Project will be hosted on <a title="EAMSteps" href="http://eamsteps.com" target="_blank">http://eamsteps.com</a>, which will by end of this month and will have all relevant documentation</li>
</ul>
<p>If you have any inputs or suggestions, please add your comments and let me know.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://scrtchpad.wordpress.com/2011/08/07/testng-or-junit/" target="_blank">TestNG or JUnit</a> (scrtchpad.wordpress.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="float: right;" src="http://img.zemanta.com/pixy.gif?x-id=781f9bb9-068f-4c22-afc8-92a1fbb59dd9" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2011/09/01/unit-testing-with-eamsteps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Publishing Project using Maven</title>
		<link>http://scratchpad101.com/2011/08/30/publishing-project-maven/</link>
		<comments>http://scratchpad101.com/2011/08/30/publishing-project-maven/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 18:36:49 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[Apache Maven]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Javadoc]]></category>
		<category><![CDATA[reporting]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=59</guid>
		<description><![CDATA[<p><img width="300" height="68" src="http://scratchpad101.com/wp-content/uploads/2011/08/Maven_logo-300x68.gif" class="attachment-medium wp-post-image" alt="Maven_logo" title="Maven_logo" /></p>In my case, it was not an invention, but it sure was a learning experience as I started exploring maven-site-plugin. This plugin generates various reports for a maven project including those that have been configured in the pom.xml file. However, it was not a straight forward implementation because I had some additional requirements like placing Google Analytics Code and placing custom Project information on my site. In this post, I will make an attempt to explain some of the things I did to help me generate my site]]></description>
			<content:encoded><![CDATA[<p><img width="300" height="68" src="http://scratchpad101.com/wp-content/uploads/2011/08/Maven_logo-300x68.gif" class="attachment-medium wp-post-image" alt="Maven_logo" title="Maven_logo" /></p><div class="zemanta-img" style="margin: 1em; display: block;">
<div class="wp-caption alignright" style="width: 310px"><a href="http://commons.wikipedia.org/wiki/File:Maven_logo.gif" target="_blank"><img title="Apache Maven logo." src="http://scratchpad101.com/wp-content/uploads/2011/09/300px-Maven_logo1.gif" alt="Apache Maven logo." width="300" height="69" /></a><p class="wp-caption-text">Image via Wikipedia</p></div>
</div>
<p>Most of us use Maven for building our projects and preparing a JAR or a WAR or an EAR to be deployed on server. However, during the development life-cycle we do not realize that Maven can be used for a much higher purpose &#8211; &#8220;Create a project site to show all of projects&#8217; information&#8221;. For many years, that I have been using Maven myself, this is something that I never thought off using to my advantage &#8211; I guess I never wanted to do something like that.</p>
<p>Last week, when I launched my project as an Open Source Library, I realized that I need a easy and quick way to make many artifacts available for my project. I have used Google for code hosting and issue tracking, however there are other documents like JavaDocs, list of dependencies, XRef Source that provide a lot of additional information which would be useful to whom so ever decides to use the library.</p>
<blockquote><p>Necessity is the mother of invention</p></blockquote>
<p>In my case, it was not an invention, but it sure was a learning experience as I started exploring <a title="Maven Site Plugin" href="http://maven.apache.org/plugins/maven-site-plugin/" target="_blank">maven-site-plugin</a>. This plugin generates various reports for a maven project including those that have been configured in the pom.xml file. However, it was not a straight forward implementation because I had some additional requirements like placing Google Analytics Code and placing custom Project information on my site. In this post, I will make an attempt to explain some of the things I did to help me generate my site.</p>
<p>To understand what I did, you should have a quick look at the <a title="iFramework Project Summary" href="http://projects.scratchpad101.com/iframework/1.0.x/index.html" target="_blank">site that I have deployed.</a> I will now start take one section at a time and explain what changes I made to my pom for that section to work. I have also attached the pom file with this post for you quick reference.</p>
<div id="attachment_73" class="wp-caption alignright" style="width: 310px"><a href="http://scratchpad101.com/wp-content/uploads/2011/08/POM-Main.png"><img class="size-medium wp-image-73" title="POM - Main" src="http://scratchpad101.com/wp-content/uploads/2011/09/POM-Main-300x162.png" alt="POM - Main" width="300" height="162" /></a><p class="wp-caption-text">POM - Main</p></div>
<p>The image on the right explains the main sections of the POM.XML. This section will configure the <a title="Project Information Section" href="http://projects.scratchpad101.com/iframework/1.0.x/project-summary.html" target="_blank">Project Information</a> and <a title="Project Team" href="http://projects.scratchpad101.com/iframework/1.0.x/team-list.html" target="_blank">Project Team</a> pages. I have added only a few details that i needed, but you can add a lot more information as you need.</p>
<p>The next section holds the License information. I am using the Apache License 2.0 and hence I am providing the URL for the license from Apache. This section generates the <a href="http://projects.scratchpad101.com/iframework/1.0.x/license.html" target="_blank">Project License</a> page for site. The next two sections define the <a href="http://projects.scratchpad101.com/iframework/1.0.x/source-repository.html" target="_blank">Project Repository</a> and <a href="http://projects.scratchpad101.com/iframework/1.0.x/issue-tracking.html" target="_blank">Issue Management</a> (Defect Management) settings.</p>
<p>Rest everything is standard POM stuff i.e. dependencies and Build plugins to run test cases etc. I am not going to take a deep dive into those because there are just so many tutorials on the same. However, what is important are the sections on <a href="http://projects.scratchpad101.com/iframework/1.0.x/apidocs/index.html" target="_blank">Java Cods</a> and <a href="http://projects.scratchpad101.com/iframework/1.0.x/xref/index.html" target="_blank">Source Code Reference</a>. To generate these two sections as a part of the Maven Site, you need to configure the Reporting Plugins as follows:</p>
<p><code lang="java5[lines]"> <reporting><br />
  &nbsp;
<plugins>
  &nbsp;&nbsp;&nbsp;
<plugin>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <groupId>org.apache.maven.plugins</groupId><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <artifactId>maven-javadoc-plugin</artifactId><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <configuration><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<links>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<link>http://download.oracle.com/javase/6/docs/api/</link>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </links>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <!--DVFMTSC--> </configuration><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <version>2.8</version><br />
  &nbsp;&nbsp;&nbsp; </plugin>
  &nbsp;&nbsp;&nbsp;
<plugin>
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <groupId>org.apache.maven.plugins</groupId><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <artifactId>maven-jxr-plugin</artifactId><br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <version>2.3</version><br />
  &nbsp;&nbsp;&nbsp; </plugin>
  &nbsp; </plugins>
 </reporting><br />
 </code></p>
<p>And lastly, to setup the left-navigation menu, you need to add a site.xml file into the &#8220;src\site&#8221; folder of you<code lang="java5[lines]"> project and provide the menu details and their linking to the pages.</code></p>
<p>In this file you can also add code for Google Analytics, you will notice in the image below that I have added the Google Analytic code to the header section which then copies the code over to each of the static HTML pages and allows me to track the same.</p>
<div id="attachment_74" class="wp-caption aligncenter" style="width: 310px"><a href="http://scratchpad101.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-31-at-12.00.02-AM.png"><img class="size-medium wp-image-74" title="Site.XML" src="http://scratchpad101.com/wp-content/uploads/2011/09/Screen-Shot-2011-08-31-at-12.00.02-AM-300x165.png" alt="Site.XML" width="300" height="165" /></a><p class="wp-caption-text">Site.XML</p></div>
<p>I hope you find this useful and are able to use it to publish your own site too.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="float: right;" src="http://img.zemanta.com/pixy.gif?x-id=44c332aa-0054-4878-946c-f7dd439b5a8f" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2011/08/30/publishing-project-maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iFramework: Updates</title>
		<link>http://scratchpad101.com/2011/08/30/iframework-updates/</link>
		<comments>http://scratchpad101.com/2011/08/30/iframework-updates/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 03:53:52 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[iFramework]]></category>
		<category><![CDATA[concurrent]]></category>
		<category><![CDATA[Exception handling]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=69</guid>
		<description><![CDATA[<p><img width="300" height="246" src="http://scratchpad101.com/wp-content/uploads/2011/08/framework1-300x246.jpg" class="attachment-medium wp-post-image" alt="framework1" title="framework1" /></p>I just released a few more framework/utility classes for this Framework. The three new features that have been added are - Exception Handling, Message Reader and Concurrent Processing]]></description>
			<content:encoded><![CDATA[<p><img width="300" height="246" src="http://scratchpad101.com/wp-content/uploads/2011/08/framework1-300x246.jpg" class="attachment-medium wp-post-image" alt="framework1" title="framework1" /></p><p>I just released a few more framework/utility classes for this Framework. The three new features that have been added are</p>
<h3>&nbsp;</h3>
<h2>Exception Handling</h2>
<p>This simple yet powerful implementation provides some of the most desirable features in any Exception Handling framework:</p>
<ul>
<li>Unchecked Exceptions for Business and System errors</li>
<li>Message Externalization</li>
<li>Message Localization</li>
<li>Configurable Message Data Sources</li>
</ul>
<h3>&nbsp;</h3>
<h2>Message Readers</h2>
<p>This package provides factory to fetch various types of Message Readers. The current implementation only supports Resource Bundle based message stores, but it can be easily extended to other data stores.</p>
<h3>&nbsp;</h3>
<h2>Concurrent Processing</h2>
<p>This package provides base classes that allow you to run your functions in a producer and consumer fashion. By using this framework you have to worry about writing your business logic for a Producer and a Consumer and not about multi-threading and how these two entities interact. This framework currently has only one implementation of a Broker i.e AsyncQueueBroker but more will be added in coming months.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://scrtchpad.wordpress.com/2011/08/24/a-new-oss-project-iframework/" target="_blank">A new OSS project: iFramework</a> (scrtchpad.wordpress.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="float: right;" src="http://img.zemanta.com/pixy.gif?x-id=73beb5f7-7846-4d56-bd5e-a5798ef30966" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2011/08/30/iframework-updates/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>i-Framework</title>
		<link>http://scratchpad101.com/2011/08/24/i-framework/</link>
		<comments>http://scratchpad101.com/2011/08/24/i-framework/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 04:26:37 +0000</pubDate>
		<dc:creator>kvahuja</dc:creator>
				<category><![CDATA[iFramework]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[loggers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://scratchpad101.com/?p=29</guid>
		<description><![CDATA[<p><img width="300" height="246" src="http://scratchpad101.com/wp-content/uploads/2011/08/framework1-300x246.jpg" class="attachment-medium wp-post-image" alt="framework1" title="framework1" /></p>A set of utilities and classes that I have found useful over the years with features like Improved Loggers, Database Setup and many more.]]></description>
			<content:encoded><![CDATA[<p><img width="300" height="246" src="http://scratchpad101.com/wp-content/uploads/2011/08/framework1-300x246.jpg" class="attachment-medium wp-post-image" alt="framework1" title="framework1" /></p><h2>Introduction</h2>
<p>This is a set of utilities and classes that I have found useful over the years. In my career spanning over a decade, I have time and again written the same code or some part of the code over and over again. I never found the time to collate the details in a reusable library. This project will be a collection of such files. The work that I have been doing is more than 5 years old, however the project has been conceived in 2011.</p>
<h2>&nbsp;</h2>
<h2>Features</h2>
<ul>
<li><a title="iFramework: Loggers" href="http://projects.scratchpad101.com/iframework/1.0.x/apidocs/index.html" target="_blank">Improved Loggers</a>: This is built on top of the Log4j and Apache Commons Logging and provides some basic and additional capabilities like</li>
<ul>
<li>Logging String</li>
<li>Logging Objects</li>
<li>Logging only if a specific type of logger is enabled, thus improving performance</li>
</ul>
<li><a title="Databsae Setup Utilities" href="http://projects.scratchpad101.com/iframework/1.0.x/apidocs/index.html" target="_blank">Database Setup</a>: During unit testing, there are times when we have to setup test data. In those cases, we are dependent on external tools like MySQL scripts or Maven builds to setup data. And, then in many cases after running a set of tests, we find the need of resetting the data to its original state. These helper classes allow us to manage such data appropriately.</li>
<li><a title="iFramework Project Summary" href="http://projects.scratchpad101.com/iframework/1.0.x/apidocs/index.html" target="_blank">Exception Handling</a>: This simple yet powerful implementation provides some of the most desirable features in any Exception Handling framework:</li>
<ul>
<li>Unchecked Exceptions for Business and System errors</li>
<li>Message Externalization</li>
<li>Message Localization</li>
<li>Configurable Message Data Sources</li>
</ul>
<li><a title="iFramework Project Summary" href="http://projects.scratchpad101.com/iframework/1.0.x/apidocs/index.html" target="_blank">Message Readers</a>: This package provides factory to fetch various types of Message Readers. The current implementation supports</li>
<ul>
<li>Resource Bundle based message stores &#8211; Messages can be read based on various locales</li>
<li>File based XML files &#8211; messages are read only for a specific locale</li>
</ul>
<li><a title="iFramework Project Summary" href="http://projects.scratchpad101.com/iframework/1.0.x/apidocs/index.html" target="_blank">Concurrent Handling</a>: This package provides base classes that allow you to run your functions in a producer and consumer fashion. By using this framework you have to worry about writing your business logic for a Producer and a Consumer and not about multi-threading and how these two entities interact. This framework currently has only one implementation of a Broker i.e AsyncQueueBroker but more will be added in coming months.</li>
<li><a title="iFramework Project Summary" href="http://projects.scratchpad101.com/iframework/1.0.x/apidocs/index.html" target="_blank">Cryptography/Secure</a>: This package provides utility classes to secure Strings that you may want to use as Passwords or Unique Tokens. This package provides three variants of the secure digest that you can generate:</li>
<ul>
<li><strong>Secure Hash</strong>: Computes a text digest using the <strong>Secure Hash Algorithm (SHA-1)</strong> which produces a 160-bit one-way digest of the text. The digest is said to be one-way since the original text cannot be recovered from it. This is ideal to use for securing passwords.</li>
<li><strong>Salted Secure Hash</strong>: Computes a text digest using the <strong>Salted Secure Hash Algorithm (SSHA)</strong> which adds extra security to the digest produced by SHA-1 by adding a <em>random string salt</em> to it. Since the salt is generated using another sufficiently random algorithm, the resultant digest is more secure than the original <em>SHA-1 digest</em>.</li>
<li><strong>Unique Token Generator</strong>: Generates text strings that can be used as unique tokens in an application. It uses the randomness of the SSHA&nbsp; algorithm to generate the tokens.</li>
</ul>
</ul>
<h2>&nbsp;</h2>
<h2>Project Details</h2>
<p>This project is developed as an Open Source technologies using Google Hosting and other other open source frameworks like <a title="SpringSource" href="http://springsource.org" target="_blank">Spring</a>, <a title="Maven" href="http://maven.apache.org/" target="_blank">Maven</a>, <a title="Apache Foundation" href="http://apache.org" target="_blank">Apache</a>, <a title="MySQL" href="http://mysql.com" target="_blank">MySQL</a> so that anyone can make use of it as they find fit.&nbsp;Project information has been hosted <a title="iFramework Project Summary" href="http://projects.scratchpad101.com/iframework/1.1.x/index.html" target="_blank">here</a> (<a href="http://projects.scratchpad101.com/iframework/1.1.x/index.html" target="_blank">http://projects.scratchpad101.com/iframework/1.1.x/index.html</a>).</p>
<h2>&nbsp;</h2>
<h2>Use / Download</h2>
<p>The project is hosted on Maven Central Repository. You can use it in your project if built via Maven by adding the following depdendency:</p>
<p><code lang="xml[lines]"><dependency><br />
  <groupId>com.kapilvirenahuja</groupId><br />
  <artifactId>iframework</artifactId><br />
  <version>1.1.0</version><br />
  <type>jar</type><br />
</dependency></code></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://scratchpad101.com/2011/08/24/i-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

