<?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>Code Explosion&#039;s Blog</title>
	<atom:link href="http://blog.codexplo.org/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.codexplo.org</link>
	<description>Code that explodes conventions</description>
	<lastBuildDate>Fri, 19 Apr 2013 12:09:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Comparing .Net IOC Frameworks</title>
		<link>http://blog.codexplo.org/2013/04/19/comparing-net-ioc-frameworks/</link>
		<comments>http://blog.codexplo.org/2013/04/19/comparing-net-ioc-frameworks/#comments</comments>
		<pubDate>Fri, 19 Apr 2013 12:07:48 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Learning Stuffs]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[Autofac]]></category>
		<category><![CDATA[Castle]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[IOC]]></category>
		<category><![CDATA[Ninject]]></category>
		<category><![CDATA[StructureMap]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=555</guid>
		<description><![CDATA[The subsequent article evaluates various IOC frameworks across a variety of areas.  The chosen frameworks, the criteria, their evaluation across the selected criteria, and the overall conclusion are described in the proceeding sections. The Chosen Frameworks Castle Project StructureMap Ninject Unity Autofac The Criteria Maturity: Maturity measures the extent of a framework’s travel.  In other [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The subsequent article evaluates various <a href="http://en.wikipedia.org/wiki/Inversion_of_control">IOC</a> frameworks across a variety of areas.  The chosen frameworks, the criteria, their evaluation across the selected criteria, and the overall conclusion are described in the proceeding sections.</p>
<h3 style="text-align: justify;">The Chosen Frameworks</h3>
<ul style="text-align: justify;">
<li><a href="http://www.castleproject.org/">Castle Project</a></li>
<li><a href="http://docs.structuremap.net/">StructureMap</a></li>
<li><a href="http://www.ninject.org/">Ninject</a></li>
<li><a href="http://unity.codeplex.com/">Unity</a></li>
<li><a href="http://code.google.com/p/autofac/">Autofac</a></li>
</ul>
<h3 style="text-align: justify;">The Criteria</h3>
<p style="text-align: justify;"><strong>Maturity:</strong> Maturity measures the extent of a framework’s travel.  In other words, maturity is a proxy for length and for frequency of usage.  These measures are a simple method to approximate quality.  Although age does not necessitate it, older frameworks tend to have fewer bugs than younger frameworks do. Consequently, maturity is a solid approximation of quality.</p>
<p style="text-align: justify;"><strong>Functionality:</strong> Functionality is a bipartite metric; it measures both the completeness of the functionality and the functionality’s usefulness. Both aspects are required, because each one measures a different aspect of functionality.  Completeness measures breadth, which is a proxy for applicability. Usefulness is a measure of utility.  Ideally, a framework should be applicable to a great many situations and highly useful to what a developer wants to achieve.  Functionality measures the degree to which a framework matches the aforementioned ideal.</p>
<p style="text-align: justify;"><strong>Performance:</strong>  Performance measures the extent to which a given framework affects the response time of software.  Slow response times elicit frustration – a reaction that tends to degrade a user base. Consequently, frameworks that negatively affect performance become unusable – so performance is a very critical criterion.</p>
<p style="text-align: justify;"><strong>Fault Tolerance:</strong> Fault tolerance measures the gracefulness with which a framework fails – an inevitable occurrence in software as all frameworks will fail at one point or another. The question is, therefore, the gracefulness of the aforementioned failure.  Some frameworks are quite graceful in their failures while others are ham-handed.  The latter sort of handling introduces bugs, which forces the surrounding software to manage carefully what is passes to the framework to prevent catastrophic failure.  However, no software is perfectly careful, so clumsy failures will inevitably lead to serious bugs.  For this reason, good frameworks fail gracefully, allowing the surround software to recover.  Fault tolerance measures the degree to which a framework has this sort of grace.</p>
<h3 style="text-align: justify;">The Evaluation</h3>
<p style="text-align: justify;"><strong>Maturity:</strong> <a href="http://docs.structuremap.net/">StructureMap</a> and <a href="http://www.castleproject.org/about-us/history/">Castle</a> are the most mature frameworks by far.  According to <a href="http://docs.structuremap.net/">StructureMap</a>, it has been used in production systems since 2004.  According to the <a href="http://www.castleproject.org/about-us/history/">Castle</a>, it began as a project in 2003.  An <a href="http://www.infoworld.com/d/developer-world/castle-built-net-084">article</a> that <a href="http://en.wikipedia.org/wiki/Castle_Project">Wikipedia</a> cites corroborates this evidence by stating that in 2006, the second release of Castle’s version one was already available.  The other frameworks have little information on their history so as best I can conclude, the projects behind these frameworks emerged between 2008 and 2010.  Consequently, <a href="http://docs.structuremap.net/">StructureMap</a> and the <a href="http://www.castleproject.org/">Castle</a> are clearly the most mature frameworks.</p>
<p style="text-align: justify;"><strong>Functionality:</strong> Author Mark Seeman provides short comparison of functionality on <a href="http://stackoverflow.com/questions/4581791/how-do-the-major-c-sharp-di-ioc-frameworks-compare">Stackoverflow</a>.  According to Seeman, <a href="http://www.castleproject.org/">Castle</a> is complete – although he does state that <a href="http://www.castleproject.org/">Castle’s</a> API is “quirky” in places – but the other frameworks either lack Castle’s features or implement them poorly, so one must take Seeman’s criticism of <a href="http://www.castleproject.org/">Castle</a> with a grain of salt.  Another <a href="http://blog.ashmind.com/2008/09/08/comparing-net-di-ioc-frameworks-part-2/">comparison</a> corroborates Seeman’s conclusion by stating that Castle has – when compared to the other frameworks – a nice set of features.  However, <a href="http://www.castleproject.org/">Castle</a> is hardly the most beloved kid on the block.  The writer of the aforementioned <a href="http://blog.ashmind.com/2008/09/08/comparing-net-di-ioc-frameworks-part-2/">comparison</a> states that he had a negative experience with <a href="http://www.castleproject.org/">Castle</a> and a <a href="http://www.sturmnet.org/blog/2010/03/04/poll-results-ioc-containers-for-net">poll</a> indicates that a sizeable number of people hate <a href="http://www.castleproject.org/">Castle</a> for no rational reason.  Clearly, <a href="http://www.castleproject.org/">Castle</a> has, in spite of its excellent feature set, some detractors – yet the aforementioned <a href="http://www.sturmnet.org/blog/2010/03/04/poll-results-ioc-containers-for-net">poll</a> also shows a sizeable number of people who have found <a href="http://www.castleproject.org/">Castle</a> to be a very good solution to their problems.  As a side note, <a href="http://docs.structuremap.net/">StructureMap</a> also polls well – an indicator that it is, in spite of its missing features, a very good solution.  Seeman’s <a href="http://stackoverflow.com/questions/4581791/how-do-the-major-c-sharp-di-ioc-frameworks-compare">comparison</a> corroborates these <a href="http://www.sturmnet.org/blog/2010/03/04/poll-results-ioc-containers-for-net">poll</a> results.   Given the aforementioned information, <a href="http://www.castleproject.org/">Castle</a> clearly emerges as the functional valedictorian, but <a href="http://docs.structuremap.net/">StructureMap</a> appears to be solid salutatorian.</p>
<p style="text-align: justify;"><strong>Performance:</strong>   Any measure of performance is heavily dependent upon the nature of the benchmark in question – as some benchmarks are biased towards particular frameworks – so the only true way to guard against tendentious measurements is to use multiple benchmarks.  I found three benchmarks – two of which were very detailed and one of which seemed rather poorly defined – but I was still able to draw some conclusions.  In the first <a href="http://www.iocbattle.com/">benchmark</a>, which provides no description of its methodology, <a href="http://docs.structuremap.net/">StructureMap</a> and <a href="http://code.google.com/p/autofac/">Autofac</a> emerge as winners, because both frameworks performed well on one test and both frameworks did admirably well on all of the tests.  The second <a href="http://www.palmmedia.de/Blog/2011/8/30/ioc-container-benchmark-performance-comparison">benchmark</a>, which very specifically defines its methodology, directly contradicts the result of the first <a href="http://www.iocbattle.com/">benchmark</a>.  With regard to Singletons, <a href="http://www.castleproject.org/">Castle</a> does not perform as poorly as it did on the first <a href="http://www.iocbattle.com/">benchmark</a>; and with regard to Transients, <a href="http://www.castleproject.org/">Castle</a> is not as slow as it was in the first <a href="http://www.iocbattle.com/">benchmark</a> either but in the middle instead.  The most detailed by far, the third <a href="http://philipm.at/2011/di_speed.html">benchmark</a> settles the argument.  <a href="http://www.castleproject.org/">Castle</a> does not have any serious performance issues, as the first benchmark indicates.  In fact, it is has relatively standard performance.  However, as all of the benchmarks indicate, <a href="http://docs.structuremap.net/">StructureMap</a> has excellent performance and <a href="http://www.ninject.org/">Ninject</a> has poor performance, so some consensus does exist.  Regardless, no serious performance drags exist, with the exception of <a href="http://www.ninject.org/">Ninject</a> and <a href="http://unity.codeplex.com/">Unity</a>, so all of the IOC frameworks appear to be solid choices with regard to performance.</p>
<p style="text-align: justify;"><strong>Fault Tolerance:</strong>  Little attention was paid to fault tolerance, so I was only able to find one <a href="http://blog.ashmind.com/2008/08/19/comparing-net-di-ioc-frameworks-part-1/">comparison</a> that addressed it.  Take what I write with a grain of salt, but the conclusions seem clear enough that they warrant mention.  When dependency resolution problems occur, <a href="http://code.google.com/p/autofac/">Autofac</a> and <a href="http://www.castleproject.org/">Castle</a> throw meaningful exceptions while the others throw Stackoverflow exceptions – a contrast that indicates that <a href="http://www.castleproject.org/">Castle</a> and <a href="http://code.google.com/p/autofac/">Autofac</a> are frameworks that are more graceful than the other ones are.  Stackoverflow exceptions crash programs, so they force an application to manage carefully what it passes to the IOC framework, because one poorly considered dependency injection could crash the application.   Such concerns cannot be entirely obviated – even when one is perfectly aware of them – so graceless errors such as Stackoverflow exceptions are a serious problem – a conclusion that makes <a href="http://www.castleproject.org/">Castle</a> and <a href="http://code.google.com/p/autofac/">Autofac</a> appear all the better.</p>
<h3 style="text-align: justify;">Conclusions</h3>
<p style="text-align: justify;"><a href="http://www.castleproject.org/">Castle</a> and <a href="http://docs.structuremap.net/">StructureMap</a> are quite close to each other in this comparison, yet one area distinguishes them: fault tolerance.  <a href="http://www.castleproject.org/">Castle</a> does not metaphorically blow up in your hand if it encounters a problem, as <a href="http://docs.structuremap.net/">StructureMap</a> does – so a programmer can feel comfortable using <a href="http://www.castleproject.org/">Castle</a> in software that must be stable.  <a href="http://www.castleproject.org/">Castle’s</a> detractors are likely to doubt this conclusion and their scoffery is well founded. <a href="http://www.castleproject.org/">Castle</a> is quirky in places and these quirks are likely to introduce frustration, which can lead to bugs – yet quirks are tractable, if they are not endemic.  Based upon on the evidence, <a href="http://www.castleproject.org/">Castle’s</a> quirks do not appear to be structural, as many developers have found it to be quite useful, so the concerns of <a href="http://www.castleproject.org/">Castle’s</a> detractors, while well founded, are moot.  As a result, <a href="http://www.castleproject.org/">Castle</a> is, in spite of its quirks, the best IOC solution for .Net.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2013/04/19/comparing-net-ioc-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Castle Project: The Basics</title>
		<link>http://blog.codexplo.org/2013/03/24/castle-project-the-basics/</link>
		<comments>http://blog.codexplo.org/2013/03/24/castle-project-the-basics/#comments</comments>
		<pubDate>Sun, 24 Mar 2013 15:47:11 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Learning Stuffs]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Castle]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[IOC]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=549</guid>
		<description><![CDATA[The Castle Project is an umbrella of open source projects.  Among them is an IOC (Inversion Of Control) framework.  I came across it, while conducting research for one of my work projects, so I decided to play with the framework to see what it could do. The subsequent code demonstrates some of these capabilities.  There [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.castleproject.org/">Castle Project</a> is an umbrella of open source projects.  Among them is an IOC (Inversion Of Control) framework.  I came across it, while conducting research for one of my work projects, so I decided to play with the framework to see what it could do. The subsequent code demonstrates some of these capabilities.  There are some additional functional elements, but this code represents the most basic functionality.</p>
<pre class="brush: csharp; title: ;">
WindsorContainer rootContainer = new WindsorContainer(); //builds the base container

//a meth to register types to the root container
public void registerToRoot(IWindsorInstaller installer)
{
    installToContainer(rootContainer,installer);
}

//installs a sub container, which can be used to represent systems
public void addContainer(string systemKey,IWindsorInstaller installer)
{
    //castle requires a sub containers to have a config file, but you don't have to use it
    IWindsorContainer container = new WindsorContainer(systemKey, rootContainer, new XmlInterpreter());
    installToContainer(container,installer);
}

//a generic method to install to a container
private static void installToContainer(IWindsorContainer container, IWindsorInstaller installer)
{
   container.Install(installer);
}

//a method to acquire a type from castle
public PolicyType acquireInstance&lt;PolicyType&gt;()
{
   PolicyType acquisition = rootContainer.Resolve&lt;PolicyType&gt;();
   return acquisition;
}

//a method to acquire an implementation from a sub container
public PolicyType acquireInstance&lt;PolicyType&gt;(string systemKey)
{
   PolicyType acquisition = rootContainer.GetChildContainer(systemKey).Resolve&lt;PolicyType&gt;();
   return acquisition;
}

//the code of the installer, which places implementations in Castle
public sealed class InstallerInstance : IWindsorInstaller
{
    public void Install(IWindsorContainer container, IConfigurationStore store)
    {
       /*
       * The code below registers an implementation of an interface.  The lifestyleMethod must be
         filled in with one that you choose (e.g singleton,transient, pooled, etc.)
       *?
       container.Register(Classes.From(someType).BasedOn&lt;someInterface&gt;().WithServiceAllInterfaces().LifestyleMethod());
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2013/03/24/castle-project-the-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interesting Tech: Document-Oriented Databases</title>
		<link>http://blog.codexplo.org/2013/02/17/interesting-tech-document-oriented-databases/</link>
		<comments>http://blog.codexplo.org/2013/02/17/interesting-tech-document-oriented-databases/#comments</comments>
		<pubDate>Sun, 17 Feb 2013 15:57:55 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[content management]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[sttuctured data]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[unstructured data]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=545</guid>
		<description><![CDATA[Everyone in the broader IT-sphere has worked with a relational database (e.g. Oracle, SQL Server, MySQL, etc.), because a great many systems could not be built without them.  Consequently, relational databases are extremely useful – but they have limitations, as all technology does.  For example, a relational database is most helpful when the data that [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Everyone in the broader IT-sphere has worked with a relational database (e.g. Oracle, SQL Server, MySQL, etc.), because a great many systems could not be built without them.  Consequently, relational databases are extremely useful – but they have limitations, as all technology does.  For example, a relational database is most helpful when the data that needs to be stored has a definite structure i.e. the data is structured.  This category subsumes a large set of data (e.g. invoice data).  However, an entire collection of data (e.g. documents, block of text, etc.) does not into the aforementioned category i.e. it is unstructured.  This type of data does not have a readily definable data structure – a quality that makes it very ill suited for a relational database.  As a result, one must ask, “How does one effectively store such data?”  The answer is a document-oriented database.</p>
<p style="text-align: justify;">Unlike relational databases, which are built around columns and rows, document-oriented databases are designed around blocks of data – a quality that makes them ideal for storing unstructured data. In a document-oriented database, a block can be a single field such as name or an amalgamated structure such as an author, which itself can contain fields and structures.  In other words, data is designed, in a document-oriented database, as though it is document.  This schema provides a convenient way to build a structure to hold data that does not fit readily into the traditional schema of rows and columns because unlike relational databases, the block structure of document-oriented databases is very flexible. As a result, document-oriented databases are quite useful with regard to unstructured data, which necessitates structural flexibility.</p>
<p style="text-align: justify;">The most obvious of these uses is document storage.  Documents, or files, can more easily be stored and more easily retrieved from a document-oriented database than they can be stored and retrieved from a relational database.   The block schema employed by document-oriented databases provides a more facile way to store documents than the rows-columns schema of relational databases does. Relational databases do provide a way to handle documents through data types such as blobs or through functionality such as file streaming.  However, these methodologies are hacks added onto the database schema to handle a common but inconvenient problem.  As a result, the easy with which document-oriented databases handle is appealing.  In fact, document-oriented databases appear to be emerging rapidly as the standard for storing documents.  They are proving to be more than simply an interesting theory regarding data storage.  Real organizations are using them.</p>
<p style="text-align: justify;">However, documents are only a small section of the potential uses for document-oriented databases; among them is content management – because any content management system (CMS) requires a storage medium.  Typically, this storage medium has been a relational database.  As previously stated, such databases have some limitations.  A relational database requires that data be defined in terms of tables, columns, and rows.  This type of structure is very restrictive and content does not fit neatly into this type of structure.  Realizing this limitation, some Java-based CMS’s use a Java Content Repository (JCR), which stores content in a tree structure instead of a collection of tables.  However, if an organization does not use Java, a JCR is not a viable solution – yet this quagmire of finding a language-compatible solution can be obviated by using a document-oriented database to store content.  Document-oriented databases are not language specific, yet they provide the same structural qualities of a JCR. As a result, content in a document-oriented database can be constructed hierarchically just as it can in a JCR – so a document-oriented database is applicable to the same problem set.  However, a document-oriented database does not lock an organization into a language – a quality that allows for solutions that are more flexible. However, I am unaware of any organization who utilizes them in this manner, but I mention this usage, because I see the potential for an elegant solution.</p>
<p style="text-align: justify;">Document-oriented databases do have their limitations, though; chief among them is the lack of discipline that relational databases enforce. Flexibility, which document-oriented databases allow, is not conducive to discipline – because flexibility brings with it the temptation for poor design. Inelegance is pursuant to this temptation.  Ideally, inelegance should be avoided and it should never be introduced by choice. As a result, storage mediums that make, in certain instances, inelegance facile should not be used under these conditions. Consequently, document-oriented databases should be avoided for that data that necessitates adherence to a strict structure i.e. the data in question is structured.  For data of this sort, relational databases are a better solution than document-oriented databases are.  Consequently, document-oriented databases are not intended to replace relational ones but to augment them instead.</p>
<p style="text-align: justify;">In spite of this ancillary status, document-oriented databases are still quite useful.  I recommend considering adding them to the IT toolkit, because they have the potential to solve certain problems more elegantly than relational databases do.  One such database to consider is <a href="http://www.mongodb.org/">MongoDB</a>.  Give it a look.  <a href="http://www.mongodb.org/">MongoDB</a> might help to solve some previously intractable problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2013/02/17/interesting-tech-document-oriented-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Paradigm: Object Manager</title>
		<link>http://blog.codexplo.org/2012/10/11/design-paradigm-object-manager/</link>
		<comments>http://blog.codexplo.org/2012/10/11/design-paradigm-object-manager/#comments</comments>
		<pubDate>Thu, 11 Oct 2012 10:11:30 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[paradigm]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=538</guid>
		<description><![CDATA[As the name suggests, object managers manage objects, but this obvious statement leaves out details that this article endeavors to describe – so what are these details?  First, the name object manager isn’t particularly helpful.   The name leaves out the specifics regarding what types of objects are managed, how these types are managed, and how [...]]]></description>
			<content:encoded><![CDATA[<p>As the name suggests, object managers manage objects, but this obvious statement leaves out details that this article endeavors to describe – so what are these details?  First, the name object manager isn’t particularly helpful.   The name leaves out the specifics regarding what types of objects are managed, how these types are managed, and how one might implement such a manager.</p>
<p>Regarding the types of objects that can be managed, an object manager has no inherent restrictions, but a developer might want to impose some anyway.  For example, a developer might consider creating – to limit the types of objects that a manager can manage – an interface (e.g. <em>IManagedObject</em>) that indicates that an object is managed.  Moreover, a manager frequently allows coders to find a specific object – so managed objects should also be limited to types that are uniquely identifiable – types that extend a special interface (e.g. <em>IUnique</em>) indicating that an object is unique.  Such restrictions are prudent to manage objects effectively.</p>
<p>However, a prudent design of managed objects does not describe how an object manager manages its objects.    Fortunately, this ambiguity can be made removed.  Put simply, object managers perform only a few simple tasks: addition, removal, search, and retrieval of the collection.  Addition adds objects to the manager.  Removal removes objects from the manager.  Search finds a specific object, if it exists.  Retrieval of the collection grabs the collection of managed objects. All of these tasks must be handled by every object manager.</p>
<p>After reading the previous paragraph, however, some coders might ask – “Shouldn’t more functionality be included in a manager?”  While quite keen, this question conflates what an object manager does with its uses inside of an application.  While a given object manager has many uses, only a few of them are endemic to managing objects.   The rest of the uses can be implemented by using the functionality described in the previous paragraph.  For example, a manager’s collection can be retrieved and the data from each object can used to search inside of another manager for one of its objects. Such a composite function does not need to be implemented inside either manager – because the standard management functions can be used to implement the composite function.</p>
<p>However, knowing what a manager manages and what a manager does is insufficient to implement an actual manager – a problem that a manager paradigm helps to eliminate.  Such a paradigm is detailed, briefly, in the subsequent code.  By extending it, one can construct a specific manager.</p>
<pre class="brush: csharp; title: ;">
public interface ICodExploUnique
{
}

public interface ICodExploManagedObject&lt;ObjectType&gt; : ICodExploUnique
   where ObjectType : ICodExploManagedObject&lt;ObjectType&gt;
{
   ICodExploManager&lt;ObjectType&gt; Manager { get; set; }
}
public interface ICodExploManager&lt;ObjectType&gt;
  where ObjectType : ICodExploManagedObject&lt;ObjectType&gt;
{
  IList&lt;ObjectType&gt; Objects { get; }
  void addObject(ObjectType obj);
  void clearObjects();
}

public interface ICodExploKeyed : ICodExploUnique
{
  String Key { get; set; }
}

public interface ICodExploKeyedManagedObject&lt;ObjectType&gt; : ICodExploManagedObject&lt;ObjectType&gt;, ICodExploKeyed
   where ObjectType : ICodExploKeyedManagedObject&lt;ObjectType&gt;
{
}

public interface ICodExploKeyedManager&lt;ObjectType&gt; : ICodExploManager&lt;ObjectType&gt;
   where ObjectType : ICodExploKeyedManagedObject&lt;ObjectType&gt;
{
   ObjectType findObject(String key);
   void removeObject(String key);
}

public abstract class BaseKeyedManager&lt;ObjectType&gt; : ICodExploKeyedManager&lt;ObjectType&gt;
		where ObjectType : ICodExploKeyedManagedObject&lt;ObjectType&gt;
	{
		#region Data

		private IList&lt;ObjectType&gt; objects;

		#endregion

		#region Constructors

		public BaseKeyedManager()
		{
			Objects = new List&lt;ObjectType&gt;(0);
		}

		#endregion

		#region ICodExploKeyedManager

		public ObjectType findObject(string key)
		{
			if (key == null)
			{
				throw new CodExploManagerException(&quot;An object cannot be found without a key&quot;);
			}
			else { }

			ObjectType found = default(ObjectType);

			foreach (ObjectType obj in objects)
			{
				if (obj.Key != null)
				{
					if (obj.Key == key)
					{
						found = obj;
						break;
					}
					else { }
				}
				else { }
			}

			return found;
		}

		public void removeObject(string key)
		{
			ObjectType found = findObject(key);

			if (found != null)
			{
				objects.Remove(found);
				found.Manager = null;

				if (found is ICodExploDestroyable)
				{
					((ICodExploDestroyable)found).destroy();
				}
				else { }
			}
			else { }
		}

		public IList&lt;ObjectType&gt; Objects
		{
			get { return objects; }
			private set { objects = value; }
		}

		public void addObject(ObjectType obj)
		{
			if (obj == null)
			{
				throw new CodExploManagerException(&quot;A null object cannot be added&quot;);
			}
			else { }

			obj.Manager = this;

			if (obj is ICodExploInitializeable)
			{
				((ICodExploInitializeable)obj).init();
			}
			else { }

			objects.Add(obj);
		}

		public void clearObjects()
		{
			objects.Clear();
		}

		#endregion
	}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2012/10/11/design-paradigm-object-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple JMonkey Rendering Utility</title>
		<link>http://blog.codexplo.org/2012/09/20/a-simple-jmonkey-rendering-utility/</link>
		<comments>http://blog.codexplo.org/2012/09/20/a-simple-jmonkey-rendering-utility/#comments</comments>
		<pubDate>Thu, 20 Sep 2012 11:46:33 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[JMonkey]]></category>
		<category><![CDATA[factory]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=532</guid>
		<description><![CDATA[Required by any JMonkey Application, rendering is a task with which any JMonkey developer must concern himself – yet how can one achieve it effectively and cleanly?  One simple solution is the creation of a utility that handles the creation of objects – a factory utility.   Such a utility places code that creates objects in [...]]]></description>
			<content:encoded><![CDATA[<p>Required by any JMonkey Application, rendering is a task with which any JMonkey developer must concern himself – yet how can one achieve it effectively and cleanly?  One simple solution is the creation of a utility that handles the creation of objects – a factory utility.   Such a utility places code that creates objects in one place.  Code that exists in fewer places is both cleaner and more easily debugged than code that exists in many places is.  This concept is one of the core tenets of modern software engineering.  The subsequent code demonstrates this concept, the concept of a factory utility, with regard to a very narrow subject – JMonkey rendering. Note: You can replace my exceptions with your own.</p>
<pre class="brush: java; title: ;">
public final class RenderUtility {
    public static Geometry createGeometry(String name, Mesh msh, Vector3f loc){
        if(name == null || msh == null || loc == null){
            throw new RenderableException(&quot;One or more parameters is null&quot;);
        }else{}

        Geometry geom = new Geometry(name, msh); //error in here when cylinder

        geom.setLocalTranslation(loc);

        return geom;
    }

    public static AbstractBox createBox(Vector3f size, boolean isFilled){
        if(size == null){
            throw new RenderableException(&quot;One or more parameters is null&quot;);
        }else{}

        AbstractBox bx = null;

        if(isFilled){
           bx = new Box(size.getX(),size.getY(),size.getZ());
        }else{
            bx = new StripBox(size.getX(),size.getY(),size.getZ());
        }

        return bx;
    }

    public static Dome createDome(int planes, int radialSamples, float radius){
        return new Dome(planes, radialSamples, radius);
    }

    public static Cylinder createCylinder(int axisSamples, int radialSamples, float radius, float height){
        return new Cylinder(axisSamples, radialSamples, radius, height);
    }

    //need to reduce parameters but will do that later
    public static Material createMaterial(AssetManager mngr, String matName, String colorName, ColorRGBA color){
        if(mngr == null || matName == null){
            throw new RenderableException(&quot;One or more parameters is null&quot;);
        }else{}

        Material mat = new Material(mngr,matName);

        if(colorName != null &amp;&amp; color != null){
            mat.setColor(colorName, color);
        }else{}

        return mat;
    }

    public static Texture createTexture(String textureName, AssetManager mngr){
        if(textureName == null || mngr == null){
            throw new RenderableException(&quot;One or more parameters is null&quot;);
        }else{}

        return mngr.loadTexture(textureName);
    }

    public static Spatial loadObjModel(AssetManager manager, String modelName, Vector3f scale, Vector3f loc){
        if(manager == null || modelName == null || scale == null){
            throw new RenderableException(&quot;Could not load model&quot;);
        }else{}

        Spatial mdlSptl = manager.loadModel(modelName);
        mdlSptl.scale(scale.getX(), scale.getY(), scale.getZ());

        if(!(mdlSptl instanceof Geometry)){
            throw new RenderableException(&quot;The model is not a geometry&quot;);
        }else{}

        ((Geometry)mdlSptl).setLocalTranslation(loc);

        return mdlSptl;
    }

    public static IScienceCraftLight createDirectionalLight(ColorRGBA color, Vector3f vec, String name){
        IScienceCraftLight light = new StandardDirectionalLight();
        light.setKey(name);

        light.setLight(createDirectionalLightSource(color,vec,name));

        return light;
    }

    public static IScienceCraftLight createPointLight(ColorRGBA color, float radius,Vector3f pos, String name){
        IScienceCraftLight light = new StandardPointLight();
        light.setKey(name);
        light.setLight(createPointLightSource(color,radius,pos,name));

        return light;
    }

    public static IScienceCraftLight createAmbientLight(ColorRGBA color, String name){
        IScienceCraftLight light = new StandardAmbientLight();
        light.setKey(name);
        light.setLight(createAmbientLightSource(color,name));

        return light;
    }

    //from: http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:light_)and_shadow
    private static DirectionalLight createDirectionalLightSource(ColorRGBA color, Vector3f vec, String name){
        DirectionalLight light = new DirectionalLight();
        light.setName(name);
        light.setColor(color);
        light.setDirection(vec.normalizeLocal());

        return light;
    }

    //from: http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:light_and_shadow
    private static PointLight createPointLightSource(ColorRGBA color, float radius,Vector3f pos, String name){
        PointLight light = new PointLight();
        light.setColor(color);
        light.setRadius(radius);
        light.setPosition(pos);
        light.setName(name);

        return light;
    }

    //from: http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:light_and_shadow
    private static AmbientLight createAmbientLightSource(ColorRGBA color, String name){
        AmbientLight light = new AmbientLight();
        light.setColor(color);
        light.setName(name);

        return light;
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2012/09/20/a-simple-jmonkey-rendering-utility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Usefulness of Type Reflection</title>
		<link>http://blog.codexplo.org/2012/09/10/the-usefulness-of-type-reflection/</link>
		<comments>http://blog.codexplo.org/2012/09/10/the-usefulness-of-type-reflection/#comments</comments>
		<pubDate>Mon, 10 Sep 2012 12:45:24 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[type reflection]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=527</guid>
		<description><![CDATA[Type reflection stores metadata about code.   On the surface, this metadata does not seem particularly useful and in many cases, it is not – yet type reflection can be quite useful.   The list below provides a rundown of ways in which type reflection can be useful. Type information:  Class metadata stores information, which can be [...]]]></description>
			<content:encoded><![CDATA[<p>Type reflection stores metadata about code.   On the surface, this metadata does not seem particularly useful and in many cases, it is not – yet type reflection can be quite useful.   The list below provides a rundown of ways in which type reflection can be useful.</p>
<ul>
<li><strong>Type information:</strong>  Class metadata stores information, which can be used, for example, to test whether a class extends another class or vice versa.   If code requires that different actions be taken for different classes, this information is clearly useful.  However, both Java and C# provide operators to test this sort of information on objects, so type reflection seems pointless, yet a code block might not be operating on an object.  It might be working on actual class information in which case the ability to test type information is actually quite helpful.</li>
<li><strong>Object construction:</strong>  Classes have constructors.  Constructors build objects.  Through type reflection, a coder can grab a specific constructor for a class.  This constructor can be used to build an object.  Typically, a coder knows the class with which he is working and simply uses the appropriate constructor – so access to constructor information seems useless. A coder might not know the class with which he is working, though.  He might only have access to the class data.  In such cases, the only way to construct an object is through type reflection.</li>
<li><strong>Type Obfuscation:</strong>  Using type reflection, class information can be grabbed by its fully qualified name.  Unlike the other examples, however, this process is very language dependent – but the concept is, regardless of the specific mechanism, the same in every language.   A string that contains all of the information to identify specifically a class is required.   This string can be used to grab the desired class information.  With this class information, type information can be tested and objects can be constructed.  A coder can use a class without having necessarily to declare it by name.</li>
</ul>
<pre class="brush: java; title: ;">
//grabbing a class
Class&lt;?&gt; c = null;
String classString = &quot;com.codexplo.somepackage.SomeClass&quot;;
c = Class.forName(classString);

//Testing type information
boolean doesClassExtend = c.isAssignableFrom(SomeOtherClass.class);

//Building An Object
Constructor&lt;?&gt; constr = c.getConstructor(new Class&lt;?&gt;[]{}); //get empty constructor
SomeClass obj = obj = (SomeClass)constr.newInstance(new Object[]{}); //use empty constructor
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2012/09/10/the-usefulness-of-type-reflection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Generics and Enums</title>
		<link>http://blog.codexplo.org/2012/08/17/java-generics-and-enums/</link>
		<comments>http://blog.codexplo.org/2012/08/17/java-generics-and-enums/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 11:58:30 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=522</guid>
		<description><![CDATA[Java considers enums to be classes, a fact that has some useful consequences.  Namely, a generic variable can be limited to accept only enums, an ability that can be quite useful to a designer.  Restricting a generic variable to accept only enumerable types allows a designer to guarantee at compile-time type safety for enums.  As [...]]]></description>
			<content:encoded><![CDATA[<p>Java considers enums to be classes, a fact that has some useful consequences.  Namely, a generic variable can be limited to accept only enums, an ability that can be quite useful to a designer.  Restricting a generic variable to accept only enumerable types allows a designer to guarantee at compile-time type safety for enums.  As long as a specific enum is passed to the generic parameter, any value that is not a part of the specified enum generates a compile-time error, which is easier to fix than a run-time error is.  The attached code demonstrates a simple example of the aforementioned concept.</p>
<p><a href="http://blog.codexplo.org/wp-content/uploads/2012/08/EnumGeneric.zip">Example Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2012/08/17/java-generics-and-enums/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Placing Static Methods into a Separate Class</title>
		<link>http://blog.codexplo.org/2012/07/30/placing-static-methods-into-a-separate-class/</link>
		<comments>http://blog.codexplo.org/2012/07/30/placing-static-methods-into-a-separate-class/#comments</comments>
		<pubDate>Mon, 30 Jul 2012 16:17:25 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=518</guid>
		<description><![CDATA[Canonical to good software design is the creation of small, focused classes.   Good software design attempts to avoid bloated classes – but how does one minimize bloating?  A number of sophisticated techniques exist, but they can be eschewed for a simpler one.  Where possible, a designer should place a class’s static methods in a separate [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Canonical to good software design is the creation of small, focused classes.   Good software design attempts to avoid bloated classes – but how does one minimize bloating?  A number of sophisticated techniques exist, but they can be eschewed for a simpler one.  Where possible, a designer should place a class’s static methods in a separate utility class.  The paragraphs below describe how one can achieve this goal.</p>
<p style="text-align: justify;">Classes often contain methods for building themselves.  Initialization might have needs beyond what a constructor provides, so an additional method is required.  Design taxonomy refers to these methods as factory methods, because they build objects.   A designer can place these methods in a separate utility class. They do not need to exist in the class that they are designed to build.  Including factory methods inside of a class leads to bloat, which is deleterious to design, so one should place, where possible, such methods in a separate class.  Following this rule reduces the size of one’s classes and as a result, the quality of design will improve.</p>
<p style="text-align: justify;">Some methods perform operations using a class, but do not need to have complete access to the class’s internal data.  A designer can place such methods in a utility class. For example, code might need the ability to combine two people through a reproductive process.   That reproductive process does need not complete internal access, so the reproductive operation need not be an internal operation.   On occasion, however, an operation such as reproduction might require functionality that is otherwise unsupported.  In such cases, a designer should create methods to handle that functionality.   Operations such as reproduction can continue to remain separate from the person class.  With that separation, the person class is less bloated than it otherwise would be.</p>
<p style="text-align: justify;">Separating the methods above and others allows a designer to achieve a clearer design.  With more focused and less bloated classes, a reader of code can more easily understand its design. For that reason, narrow, lean classes are canonical to good design.   Separating static methods from classes where possible is one aid to achieving the lean, focused classes that good design demands.</p>
<p style="text-align: justify;"><a href="http://blog.codexplo.org/wp-content/uploads/2012/07/Utility.zip">The sample code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2012/07/30/placing-static-methods-into-a-separate-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating a String in Dot Net</title>
		<link>http://blog.codexplo.org/2012/07/11/generating-a-string-in-dot-net/</link>
		<comments>http://blog.codexplo.org/2012/07/11/generating-a-string-in-dot-net/#comments</comments>
		<pubDate>Wed, 11 Jul 2012 23:09:09 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[generation]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=513</guid>
		<description><![CDATA[Strings are the bane of a coder’s existence.  In all respects, handling string-dependent operations is ungainly.   To ameliorate such unwieldiness, Dot Net has some utilities that make a particular aspect of string operations more elegant: string generation.   The proceeding paragraphs describe the specifics of these utilities and their applications to string generation. One of the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Strings are the bane of a coder’s existence.  In all respects, handling string-dependent operations is ungainly.   To ameliorate such unwieldiness, Dot Net has some utilities that make a particular aspect of string operations more elegant: string generation.   The proceeding paragraphs describe the specifics of these utilities and their applications to string generation.</p>
<p style="text-align: justify;">One of the more common ways to generate a string is the amalgamation of multiple strings into one, which a coder typically achieves through <strong>concatenation</strong>. However, concatenation is <strong>awkward</strong> and <strong>messy</strong>.  Dot Net has a more graceful method.  <strong>String.Format</strong> achieves the same result but in a more <strong>agile</strong> way.  By using <strong>String.Format</strong>, a coder can insert several strings into a surrounding template.  From those strings and template, <strong>String.Format</strong> produces a string.  Code that produces strings in this manner is much more graceful than concatenation is, because the intended result is much clearer.   Consequently, <strong>String.Format</strong> produces less clunky code.</p>
<p style="text-align: justify;">Still, the more graceful <strong>String.Format</strong> only provides so much benefit.  A coder cannot obviate all of problems of string generation through <strong>String.Format</strong>.  For starters, the parts of a string template can be <strong>complex</strong> and/or <strong>highly variable</strong>.   A programmer can make each part of the template simpler by adding more parts, but that cure might be worse than the disease ease.  A string template with a large number of parts does not look much better than a string created through concatenation does.  As a result, graceful string generation requires another utility.</p>
<p style="text-align: justify;">Similar to <strong>String.Format</strong>, <strong>StringBuilder</strong> allows a coder to create a string out of several parts.   Unlike <strong>String.Format</strong>, however, <strong>StringBuilder</strong> allows a coder to add parts as needed; a string can be <strong>piecemealed</strong>.  That ability to build a string a piece at a time is incredibly useful.   Highly variable pieces of strings that cannot be built using <strong>String.Format</strong> can be built using <strong>StringBuilder</strong>. As a result, <strong>StringBuilder</strong> enhances the Dot Net tool belt.</p>
<p style="text-align: justify;">Using these tools of the DotNet tool belt, <strong>String.Format</strong> and <strong>StringBuilder</strong>, a coder is able to construct strings in a graceful way. With its templates, <strong>String.Format</strong> can wrap a highly complex and variable string constructed through <strong>StringBuilder </strong>inside a template.  A coder wielding this technique can generate even the most unwieldy of strings in a graceful way.  As a result, a coder can alleviate a sizeable part of a major source of his headaches.</p>
<pre class="brush: csharp; title: ;">
/*
			 * The code below uses String.Format to build a string out parts.
			 * As one can clearly see, the resulting is clear, but this code
			 * becomes brittle if the need to change.
			 */
			String tableName = &quot;Table1&quot;;
			String fields = &quot;field1, field2, field3&quot;;
			String parameters = &quot;@field1, @field2, @field3&quot;;
			String insertStatement = String.Format(&quot;INSERT INTO {0} ({1}) VALUES ({2}); SET NOCOUNT ON; SELECT Scope_Identity();&quot;, tableName, fields, parameters);

			System.Console.WriteLine(insertStatement);

			/*
			 * The code below demontrates the combination of String.Format
			 * and StringBuilder.  The field array is hard coded but using this
			 * approach.  The array and table name could easily from an object.
			 * The approach still produces clear strings but is much more
			 * flexible.
			 */

			StringBuilder fieldsBldr = new StringBuilder();
			StringBuilder parameterBldr = new StringBuilder();
			String[] fieldsArr = new String[] { &quot;field1&quot;, &quot;field2&quot;, &quot;field3&quot; };

			bool isFirst = true;
			foreach (String field in fieldsArr)
			{
				if (isFirst)
				{
					fieldsBldr.Append(field);
					parameterBldr.Append(String.Format(&quot;@{0}&quot;, field));
					isFirst = false;
				}
				else {
					fieldsBldr.Append(&quot;, &quot;);
					fieldsBldr.Append(field);
					parameterBldr.Append(&quot;, &quot;);
					parameterBldr.Append(String.Format(&quot;@{0}&quot;, field));
				}
			}

			String bldrFormatInsertStatement = String.Format(&quot;INSERT INTO {0} ({1}) VALUES ({2}); SET NOCOUNT ON; SELECT Scope_Identity();&quot;, tableName, fieldsBldr.ToString(), parameterBldr.ToString());

			System.Console.WriteLine(bldrFormatInsertStatement);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2012/07/11/generating-a-string-in-dot-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Naming Conventions to Follow</title>
		<link>http://blog.codexplo.org/2012/05/14/simple-naming-conventions-to-follow/</link>
		<comments>http://blog.codexplo.org/2012/05/14/simple-naming-conventions-to-follow/#comments</comments>
		<pubDate>Mon, 14 May 2012 17:35:25 +0000</pubDate>
		<dc:creator>Collin Rusk</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[conventions]]></category>
		<category><![CDATA[naming]]></category>

		<guid isPermaLink="false">http://blog.codexplo.org/?p=507</guid>
		<description><![CDATA[Simple Naming Conventions to Follow To code clearly, one must use to indentify coding elements appropriate, precise names.  Named appropriately and precisely, the names of coding elements provide to the reader clear, accurate information.  With that information, the reader is able to understand more easily the code that he is perusing.  Consequently, naming conventions that [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: justify;">Simple Naming Conventions to Follow</h1>
<p style="text-align: justify;">To code clearly, one must use to indentify coding elements appropriate, precise names.  Named appropriately and precisely, the names of coding elements provide to the reader clear, accurate information.  With that information, the reader is able to understand more easily the code that he is perusing.  Consequently, naming conventions that produce appropriate, precise names are essential for writing good code. As a means to achieve such names, the list below provides guidelines.</p>
<ol style="text-align: justify;">
<li>The names of all <strong>interfaces</strong> and <strong>classes</strong> should <strong>begin</strong> with a <strong>capital letter</strong>.   This convention is simply good, object-oriented form.  Beginning classes and interfaces with a capital letter helps a reader to identify types.</li>
<li>All <strong>interface</strong> names should <strong>begin</strong> with the <strong>letter </strong>“<strong>I</strong>.”   This convention is borrowed from DotNet.  The letter “I” provides a shorthanded, simple way to identify interfaces.</li>
<li>Any <strong>class </strong>that is intended to be used as a <strong>base class</strong> should have in its name the <strong>word</strong> “<strong>base.</strong>”  With “<strong>base</strong>” in the name, a reader knows that the designer intended a class to be used as a building -block.  As a result, a reader can easily distinguish between building blocks and non-building-blocks.</li>
<li>Any <strong>class</strong> that contains only <strong>static methods</strong> should have in its name the <strong>word</strong> “<strong>utility</strong>” or “<strong>library.</strong>”  Such words signify to the coder that a class is intended to be used as a helper.</li>
<li>The names of all <strong>methods</strong> and <strong>functions</strong> should <strong>begin</strong> with a <strong>lowercase letter</strong>.  Similar to the first rule, this convention is simply good, object-oriented form.  Such a convention assists a reader in distinguishing easily between classes and methods.</li>
<li>All <strong>method</strong> names and function <strong>names</strong> should contain a <strong>verb</strong>.  Including in the name a verb allows the reader to identify easily actions.</li>
<li>All <strong>variable </strong>names and<strong> field</strong> names should<strong> begin</strong> with a <strong>lowercase letter</strong>.  Similar to the first and fourth tips, this convention is simply good, object-oriented form.  Such a convention helps a reader to distinguish easily between data and classes.</li>
<li>All <strong>variable names</strong> and <strong>field names</strong> should contain, unless their type is Boolean, a <strong>noun</strong>.  By including a noun in the name, a coder helps reader to identify easily data.</li>
<li>Any <strong>variable</strong> name or <strong>field</strong> name whose data type is <strong>Boolean</strong> should be formulated as a <strong>question</strong>.  Similar to the first, fourth, and sixth tips, this convention is simply good, object-oriented form.   A coder who formulates Boolean data as a question helps a reader to distinguish easily between flags and data.</li>
<li>The <strong>letters</strong> of any <strong>constant</strong> should be <strong>capital letters</strong>.  This convention is simply good structured form.  Making a constant’s letters capital allows a reader to distinguish between constants and everything else.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexplo.org/2012/05/14/simple-naming-conventions-to-follow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
