<?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>iBlog, iByte, iBrianiBlog, iByte, iBrian &#187; Uncategorized</title>
	<atom:link href="http://blog.brianbuikema.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.brianbuikema.com</link>
	<description>Technology Moves as Fast as We Move It by Brian Buikema</description>
	<lastBuildDate>Tue, 05 Mar 2013 15:33:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Software Architecture:  Creating a Solutions Architecture</title>
		<link>http://blog.brianbuikema.com/2012/10/software-architecture-creating-a-solutions-architecture/</link>
		<comments>http://blog.brianbuikema.com/2012/10/software-architecture-creating-a-solutions-architecture/#comments</comments>
		<pubDate>Sun, 21 Oct 2012 04:38:56 +0000</pubDate>
		<dc:creator>Brian Buikema</dc:creator>
				<category><![CDATA[Architecture & Design]]></category>
		<category><![CDATA[Enterprise]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Solutions Architecture]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[solutions architecture]]></category>
		<category><![CDATA[startups]]></category>

		<guid isPermaLink="false">http://blog.brianbuikema.com/?p=1398</guid>
		<description><![CDATA[Overview A Solutions Architecture aims to address specific problems and requirements, usually through the design of specific information systems or applications, and typically accommodates many different audiences as it addresses direct business and technical concerns without dropping down to the nuts and bolts of the software architecture. Note, that I provided a link to Wikipedia&#8217;s definition, but I [...]]]></description>
			<content:encoded><![CDATA[<h1>Overview</h1>
<p>A <a href="http://en.wikipedia.org/wiki/Solution_architecture"><em>Solutions Architecture</em></a> aims to address specific problems and requirements, usually through the design of specific information systems or applications, and typically accommodates many different audiences as it addresses direct business and technical concerns without dropping down to the nuts and bolts of the software architecture.</p>
<p>Note, that I provided a link to Wikipedia&#8217;s definition, but I have expanded that definition to be more specific regarding its intended audiences and provided level of detail.</p>
<p>It should be noted, that my intention is not to advocate a Solutions Architecture as another tedious task in the software development process, but to provide a <em>software architecture practice</em> that is</p>
<ul>
<li>practical and useful by a broad audience,</li>
<li>flexible in its composition, and</li>
<li>well understood, especially by business and technical folks.</li>
</ul>
<p>Many times, I&#8217;ve seen the impedance mismatch, e.g., technical jargon, business jargon, expectations, communications, etc&#8230;, go unnoticed, or ignored, far too long.  A Solutions Architecture provides a proven strategy to effectively guide architecting software systems.</p>
<p>In this post, I delve into the concept of <em>Current State Architecture</em> and <em>Future State Architecture </em>and how identifying these help guide us to the ultimate goal, the <em>Solutions Architecture.  </em>If it is discerned through the Solutions Architecture, that the current state architecture is unacceptable, work can begin on creating the future state software architecture.</p>
<p>Please click on the link if you are looking for information on helping you determine</p>
<blockquote><p><a href="http://blog.brianbuikema.com/2012/10/software-architecture-when-is-it-time-to-revisit-your-current-software-architecture/">&#8220;When is it time to revisit my current software architecture?&#8221; - another post by B. Buikema</a></p></blockquote>
<h1>Solutions Architecture</h1>
<p>A Solutions Architecture is typically written as slides, e.g., a powerpoint presentation, not straight-up, highly-textual, documentation.  It is comprised of content and diagrams that provide a 360 degree view of a software architecture as a total solution.  Details such as algorithms, code snippets, detailed designs (i.e., UML class, sequence, state, etc&#8230;) are typically omitted.</p>
<blockquote><p>NOTE:  Companies typically have business and engineering folks whose tolerance for documentation is either small or large, and this is driven by the company culture.  I recommend that the Solution Architecture is kept as tight and to-the-point as possible to match this tolerance.  However, make sure that any items deemed important by folks are, in fact, included to ensure buy-in by all parties.  I will also identify those items I believe are absolutely necessary.</p></blockquote>
<p>Typical items found in a Solutions Architecture are</p>
<ul>
<li>Statement of Work (SOW)</li>
<li>Goals</li>
<li>Considerations</li>
<li>Use Cases</li>
<li>Conceptual Architecture</li>
<li>Logical Architecture</li>
<li>Security Architecture</li>
<li>Information Architecture</li>
<li>Physical Architecture</li>
<li>Network Operations Center (NOC) Requirements</li>
<li><em>CURRENT STATE:</em>  Discussion of Business and Technical Gaps</li>
<li><em>FUTURE STATE:</em>  Solutions to Business and Technical Gaps</li>
<li>Non-Functional Requirements (NFR&#8217;s)</li>
<li>Engineering Development Staffing Requirements (e.g., roles/skills)</li>
<li>NOC Staffing Requirements (e.g., roles/skills)</li>
<li>Operations Staffing Requirements (e.g., roles/skills)</li>
</ul>
<h2>SOW</h2>
<p>This is the statement of work and is usually a paragraph or two describing the intent of the system or application.</p>
<h2>Goals</h2>
<p>Provide key goals important to both the business and engineering.</p>
<h2>Considerations</h2>
<p>Key considerations include, but are not limited to</p>
<ul>
<li>targeted business markets/consumers</li>
<li>targeted technologies/platforms</li>
<li>keeping legacy features (or not)</li>
<li>short and/or long-term business plans</li>
<li>short and/or long-term technical plans</li>
<li>user privacy policies</li>
<li>sensitivity to cost and time</li>
</ul>
<h2>Use Cases</h2>
<p>These are typically high-level and include all major actors and relevant use cases.  Include all roles and responsibilities, and, if you&#8217;re unsure, it is better to include than exclude.</p>
<h2>Conceptual Architecture</h2>
<p>This is the loosest of the architecture diagrams, but can set the stage for understanding the  other architectural views.</p>
<p>The Conceptual Architecture provides a view depicting high-level, conceptual systems, subsystems, and/or applications, and their importance to the actors and use cases.  This is commonly just arrows from the actors to a high-level component and stating the high-level use case it represents.  There are typically no hard and fast rules in creating a Conceptual Architecture, but it is useful when discussing the high-level architecture.</p>
<h2>Logical Architecture</h2>
<p>The Logical Architecture depicts the logical view of the system or application and commonly identifies the main software components as follows:</p>
<ul>
<li>systems</li>
<li>subsystems</li>
<li>applications</li>
<li>servers (such as email and web servers)</li>
<li>services</li>
</ul>
<p><span style="font-size: medium;"><span style="line-height: 24px;">A Logical Architecture need not concern with the attributes of the physical environment.<br />
</span></span></p>
<div>
<h2>Security Architecture</h2>
<p>The Security Architecture typically includes details on</p>
</div>
<ul>
<li>data in flight</li>
<li>data at rest</li>
<li>authentication and authorization</li>
</ul>
<h2>Information Architecture</h2>
<p>The Information Architecture may include core data schemas, data flows, transactions, workflows, etc,&#8230; NOTE:  It&#8217;s advisable not to delve to deep on these, keep them at high-level to satisfy the use cases and come of the other architecture diagrams.</p>
<h2>Physical Architecture</h2>
<p>This depicts a diagram(s) the physical environment(s) of the components the system or application is hosted on.  Server nodes, clusters, firewalls, databases, are just some of the components identified.  Details to the physical hosting and interfacing are well established.</p>
<h2>NOC Requirements</h2>
<p>NOC requires various deployment and topological network diagrams for each environment they maintain to host the system or application.  This usually includes Production, Testing, Staging, and Development.</p>
<h2>Discussion of Business and Technical Gaps</h2>
<p>This is relevant to the Current State Architecture only (see below).</p>
<p>The business gaps can commonly be captured in a table format, identifying the feature, the problem/challenge, the folks affected, and the priority of importance.</p>
<p>The technical gaps are similar, but describe the technical difficulty, of course.</p>
<p>You can also see how useful this becomes when you map the two together to form an end-to-end understanding of why the business problems/challenges occur.</p>
<h2>Solutions to Business and Technical Gaps</h2>
<p>This is relevant to the Future State Architecture only (see below).</p>
<p>Taking the details discussed in the <em>Discussion of Business and Technical Gaps</em>, each item should be identified and given a description of the solution along with a measurement of how well the solution solve the actual problem/challenge,</p>
<p>For example, you can adopt 0 &#8211; 5, where</p>
<ul>
<li>0 represents <em>no solution</em>,</li>
<li>1 represents <em>20% solved</em> and</li>
<li>5 represents <em>100% solved</em>.</li>
</ul>
<h2>NFR&#8217;s</h2>
<p>NFR&#8217;s typically include details that are not always given to engineering, but are critical to operations</p>
<ul>
<li>availability</li>
<li>disaster recovery</li>
<li>performance and scaleability</li>
<li>elasticity</li>
<li>instrumentation</li>
<li>data backup and retention</li>
</ul>
<h1>Representing a Solutions Architecture Through States</h1>
<p>In order to effectively compare and contrast different solutions architectures, it is necessary to provide a baseline, also known as the <em>current state architecture</em>.  And new solutions known as the <em>future state architecture</em>.  This nicely allows us to describe the state of the union as we see it today, and optional solutions that are possibilities for the future.</p>
<h2>Current State Architecture</h2>
<p>Simply stated, this is the current state of the software architecture.  In addition to the architectural specifics, the gaps in both business and technical are included.</p>
<p>In addition to the typical items listed above, the following are specific to the current state:</p>
<ul>
<li>Business Gaps in the Current Architecture</li>
<li>Technical Gaps in the Current Architecture</li>
</ul>
<p><span style="font-size: medium;"><span style="line-height: 24px;">The exercise in creating the Current State Architecture is rewarding as the results make it much easier to justify arguments made in the past that were harder to prove.<br />
</span></span></p>
<div>
<h2>Future State Architecture</h2>
<p>This is the future state software architecture.  In addition to the architectural specifics, the solution to the gaps in both business and technical are included.  Also, technology research, proof-of-concept, and technology selection details are provided.</p>
<p>In addition to the typical items listed above, the following are specific to the future state:</p>
<div>
<ul>
<li>Technology Research, Proof-of-Concept, and Selection</li>
<li>Solving Business Gaps in the Current Architecture</li>
<li>Solving Technical Gaps in the Current Architecture</li>
</ul>
</div>
</div>
<h2>Recommendations</h2>
<p>I recommend the following, at a minimum, as I strongly believe they are core to defining a Solutions Architecture:</p>
<ul>
<li>Statement of Work (SOW)</li>
<li>Goals</li>
<li>Use Cases</li>
<li>Logical Architecture</li>
<li>Security Architecture</li>
<li>Information Architecture</li>
<li>Physical Architecture</li>
<li>NOC Requirements</li>
<li>Non-Functional Requirements (NFR&#8217;s)</li>
<li><em>CURRENT STATE:</em>  Discussion of Business and Technical Gaps</li>
<li><em>FUTURE STATE:</em>  Solutions to Business and Technical Gaps</li>
</ul>
<p><span style="font-size: medium;"><span style="line-height: 24px;">The actual details for each of the above can be brief, as long as any details that can affect the final decision are surfaced enough for clear discussion.  For example, identifying high-level data schema(s) are suffice for the Information Architecture as long as key data stores (e.g., databases) are present in the diagram.<br />
</span></span></p>
<h1>Using the Current and Future State Architectures to Identify the Winning Solutions Architecture</h1>
<p>This is where the rubber hits the road and the real decisions can be made.</p>
<p>Now all of the facts are within easy reach to do comparisons and open up discussions that can include both business and technical folks.  This proves fruitful for a company&#8217;s future, as the business can share its short and long-term needs and engineering can understand its limitations, if any, and together well-informed decisions can now be made going forward.</p>
<h1>Moving Forward</h1>
<p>Coming up in the near future, I will discuss using the <em>Solutions Architecture</em> to drive creation of the <em>Software Architecture</em>.</p>
<p>Please click on the link below if you are looking for information on helping you determine</p>
<blockquote><p><a href="http://blog.brianbuikema.com/2012/10/software-architecture-when-is-it-time-to-revisit-your-current-software-architecture/">&#8220;When is it time to revisit my current software architecture?&#8221; - another post by B. Buikema</a></p></blockquote>
<p>I also have many other posts regarding</p>
<ul>
<li><a href="http://blog.brianbuikema.com/tag/architecture">software architecture</a></li>
<li><a href="http://blog.brianbuikema.com/tag/mobile">mobile (Android) development</a></li>
<li><a href="http://blog.brianbuikema.com/tag/enterprise">enterprise development</a></li>
<li><a href="http://blog.brianbuikema.com/tag/design-patterns">design patterns</a></li>
<li><a href="http://blog.brianbuikema.com">and much more&#8230;</a></li>
</ul>
<p>so look me up.</p>
<p>See you soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianbuikema.com/2012/10/software-architecture-creating-a-solutions-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Architecture:  When is it Time to Revisit Your Current Software Architecture?</title>
		<link>http://blog.brianbuikema.com/2012/10/software-architecture-when-is-it-time-to-revisit-your-current-software-architecture/</link>
		<comments>http://blog.brianbuikema.com/2012/10/software-architecture-when-is-it-time-to-revisit-your-current-software-architecture/#comments</comments>
		<pubDate>Sun, 21 Oct 2012 03:23:59 +0000</pubDate>
		<dc:creator>Brian Buikema</dc:creator>
				<category><![CDATA[Architecture & Design]]></category>
		<category><![CDATA[Enterprise]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Solutions Architecture]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[solutions architecture]]></category>
		<category><![CDATA[startups]]></category>

		<guid isPermaLink="false">http://blog.brianbuikema.com/?p=1374</guid>
		<description><![CDATA[Overview In this post, I discuss an important topic in software architecture: &#8220;When is it time to revisit my current software architecture?&#8221; As a software developer, software architect, solutions architect, software product manager, and software consultant (I&#8217;ve been all of them), I have to come into companies to help make decisions regarding the future of [...]]]></description>
			<content:encoded><![CDATA[<h1>Overview</h1>
<p>In this post, I discuss an important topic in software architecture:</p>
<blockquote><p>&#8220;When is it time to revisit my current software architecture?&#8221;</p></blockquote>
<p>As a software developer, software architect, solutions architect, software product manager, and software consultant (I&#8217;ve been all of them), I have to come into companies to help make decisions regarding the future of a current software architecture.  Typically, I&#8217;ve seen several camps, but we&#8217;ll keep our attention focused on these two:</p>
<h2>Startup</h2>
<p>Application coded/tested/deployed to early visionary&#8217;s specs.  Sales is able to sign up some clients.  Clients report mostly good things about the application.  Venture Capitalists (VC&#8217;s) are interested.  Demonstration to VC&#8217;s went great and funding approved!  But engineering says</p>
<ul>
<li>the architecture can&#8217;t scale</li>
<li>it isn&#8217;t robust enough for rapid growth</li>
<li>it wasn&#8217;t designed to do those <em>fancy</em> phase 2, 3, 4, etc&#8230;, features, since we were told to get phase 1 out the door asap.</li>
</ul>
<p>We&#8217;ve all been there.  Now what?</p>
<p>Likely problem:  No real software architecture existed in the first place.  Consider this a <em>working prototype</em>, but no more than that<em>.</em></p>
<h2>Mature</h2>
<p>Application has been in production for several years and supports our clients, but is horrible to maintain, operate, and extend.  The current technology platform is aging and is stifling the business&#8217;s ability to add features that the competition already provides, e.g., mobile support.  The CTO sees a new technology platform that may be the <em>silver bullet</em> to all of these problems.</p>
<p>But what now?</p>
<p>Likely problem:  <em>Software Architecture Erosion</em>.  I&#8217;ll discuss this in detail in the next section.</p>
<h1>Limitations in the Current Software Architecture &#8211; Denial or Reality?</h1>
<p>Most software folks know that there are weaknesses in the software.  Some even know, dare I say, that there are weaknesses in their own code!  However, is it really the code, the design of the code, or the architecture?</p>
<p>Keep in mind, the code can normally cleaned up (given time), and the design can be normally cleaned up (also given time).  This is considered re-factoring and is a normal part of software development.</p>
<p>Software architecture can be a different story, however.  Depending on the lack of proper logical layers, violation of architecture patterns, tightly-coupled interfaces, implicit or explicit use of technology platform-specific communications, strong dependency to a specific type of data store, and more, can contribute to a software architecture&#8217;s limitations.  These limitations normally result in adversely affecting one or more of the following:</p>
<ul>
<li>ability to provide a robust architecture that can handle any kind of stress in both extensibility and resource usage, including any changes to the operating environment, and still provide the desired application functionality</li>
<li>ability to scale to meet growth demands</li>
<li>ability to create/extend features without excessively increasing software complexity</li>
<li>ability to communicate with other software components/technologies</li>
<li>and more&#8230;</li>
</ul>
<p><span style="font-size: medium;"><span style="line-height: 24px;">Ultimately, this leads to <em><a href="http://en.wikipedia.org/wiki/Software_architecture#Software_architecture_erosion">software architecture erosion</a></em>.</span></span></p>
<h2>Software Architecture Erosion</h2>
<p>Simply stated, software architecture erosion is the deterioration of the software architecture by the cumulative effect of numerous implementation decisions that violate the planned architecture.</p>
<p>Let&#8217;s take a look at a typical software architecture as time passes.  Fig 1 depicts the development of new features that are released through new versions.</p>
<p><a href="http://blog.brianbuikema.com/wp-content/uploads/2012/10/Enterprise-Dev-Fig-12.jpg"><img class="aligncenter size-medium wp-image-1431" title="Fig 1" src="http://blog.brianbuikema.com/wp-content/uploads/2012/10/Enterprise-Dev-Fig-12-500x354.jpg" alt="Fig 1" width="500" height="354" /></a><br />
We&#8217;ll also see that during the first three versions, the software architecture has been adhered to as shown in Fig 2.</p>
<p><a href="http://blog.brianbuikema.com/wp-content/uploads/2012/10/Architecture-Fig-21.jpg"><img class="aligncenter size-medium wp-image-1441" title="Fig 2" src="http://blog.brianbuikema.com/wp-content/uploads/2012/10/Architecture-Fig-21-500x414.jpg" alt="Fig 2" width="500" height="414" /></a></p>
<p>&nbsp;</p>
<p>However, things changed for version 4 and 5, as the business decided to expand into other markets and required some conceptually new features that were not envisioned by the planned architecture.  Fig 3 depicts versions 1 through 5.</p>
<p><a href="http://blog.brianbuikema.com/wp-content/uploads/2012/10/Architecture-Fig-31.jpg"><img class="aligncenter size-medium wp-image-1442" title="Fig 3" src="http://blog.brianbuikema.com/wp-content/uploads/2012/10/Architecture-Fig-31-500x346.jpg" alt="Fig 3" width="500" height="346" /></a></p>
<p>As can be seen by the dashed line, the system complexity has increased drastically as the software development team made the decision to violate the planned software architecture in order to accommodate the requested business features.  This is a sure sign of <em>software architecture erosion </em>and puts limitations on future features, release schedules, and more.</p>
<p>One might ask, &#8220;Is there a test I can apply to know if there is a need to rethink our current software architecture?&#8221;</p>
<p>One can look at</p>
<ul>
<li>feature time-to-complete creep,</li>
<li>guage any increases in frustration in the software development team, and</li>
<li>readily perform stress and load tests to obtain performance metrics.</li>
</ul>
<p>One can also identify</p>
<ul>
<li>fragmented business logic spread in multiple layers/components,</li>
<li>tightly-coupled interfaces, and</li>
<li>technology platform-specific communications.</li>
</ul>
<p>Keep in mind, the seniors on the engineering/NOC team <em>know</em> many of the limitations.  Don&#8217;t kid yourself.  The key is determining how much erosion as occurred and how will affect the business in the near and far future.</p>
<h1>Don&#8217;t Look Now, but Someone Booked a Meeting During Your Lunch Hour!</h1>
<p>So now talk about the limitations of the current architecture are omnipresent.</p>
<p>Time for meetings.</p>
<p>Commonly, I see meeting after meeting after meeting occur, where the business stake holders meet with engineering/IT/QA to convey/capture business needs, while engineering meets with platform vendors to attend presentations.  Usually, a few engineering folks quietly discuss what should <em>really</em> be done.  Sometimes business folks learn of a new upcoming technology, and pass this along to engineering as well.</p>
<p>While none of these are inherently bad by themselves, they do indicate a lack of direction that needs to occur.  E<em>veryone</em> has opinions and ideas that provide fragments of a solution, but collectively, these do not provide a complete solution.  Also, I&#8217;ve seen literally hundreds of man hours wasted because these meetings occur, often in silos, and, therefore, folks are not collaborating on</p>
<ul>
<li>understanding the challenges and problems with the current application</li>
<li>understanding upcoming features and future targeted business growth (e.g., 6 mo&#8217;s, 12 mo&#8217;s, 24 mo&#8217;s) that the application must support</li>
<li>prioritizing and time-lining of the above</li>
<li>creating a strategy to help discover a solution</li>
</ul>
<div><span style="font-size: medium;"><span style="line-height: 24px;">Sure, spreadsheets, documents, and emails are written and sent out (mainly by business analysts), but it&#8217;s very likely that most folks don&#8217;t understand the intent of each item.</span></span></div>
<blockquote><p>A common knowledge of the problem must be understood and shared, and a practical strategy must be identified to facilitate the collaborative discovery of a solution.</p></blockquote>
<h1>The Solution</h1>
<p>What it comes down to is understanding all views, or dimensions, of your current software architecture, and conducting an objective review of it by all stakeholders.  You may be thinking,</p>
<blockquote><p>&#8220;How can business folks possibly understand the technical details of the software architecture in order to provide valid input to this important exercise?&#8221;</p></blockquote>
<p>The answer.  Because you will provide a <em>Solutions Architecture</em> that will accommodate many different audiences as it collectively, and without deep-down details, addresses direct business and technical concerns.</p>
<p>In my post, <em><a href="http://blog.brianbuikema.com/2012/10/software-architecture-creating-a-solutions-architecture">Creating a Solutions Architecture</a></em>, I delve into the concept of <em>Current State Architecture</em> and <em>Future State Architecture </em>and how identifying these help guide us to the ultimate goal, the <em>Solutions Architecture.</em></p>
<p>I also have many other posts regarding</p>
<ul>
<li><a href="http://blog.brianbuikema.com/tag/architecture">software architecture</a></li>
<li><a href="http://blog.brianbuikema.com/tag/mobile">mobile (Android) development</a></li>
<li><a href="http://blog.brianbuikema.com/tag/enterprise">enterprise development</a></li>
<li><a href="http://blog.brianbuikema.com/tag/design-patterns">design patterns</a></li>
<li><a href="http://blog.brianbuikema.com">and much more&#8230;</a></li>
</ul>
<p>so look me up.</p>
<p>See you soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianbuikema.com/2012/10/software-architecture-when-is-it-time-to-revisit-your-current-software-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Part 4 – Developing Proximity Alerts for Mobile Applications using the Android Platform</title>
		<link>http://blog.brianbuikema.com/2010/07/part-4-developing-proximity-alerts-for-mobile-applications-using-the-android-platform/</link>
		<comments>http://blog.brianbuikema.com/2010/07/part-4-developing-proximity-alerts-for-mobile-applications-using-the-android-platform/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 05:46:31 +0000</pubDate>
		<dc:creator>Brian Buikema</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Architecture & Design]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Location-Based]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Proximity Alerts]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[architecture]]></category>

		<guid isPermaLink="false">http://blog.brianbuikema.com/?p=1040</guid>
		<description><![CDATA[I&#8217;ve decided to add this fourth part to discuss making some beneficial enhancements to the Proximity Alerts Mobile Application we developed in the earlier posts (Part 1, Part 2, and Part 3).  Our goal in Parts 1- 3 was to create an Android-based mobile application that demonstrated some basic proximity alert functionality.  And we successfully [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to add this fourth part to discuss making some beneficial enhancements to the <em>Proximity Alerts Mobile Application</em> we developed in the earlier posts (<a href="http://blog.brianbuikema.com/2010/07/part-1-developing-proximity-alerts-for-mobile-applications-using-the-android-platform/" target="_blank">Part 1</a>, <a href="http://blog.brianbuikema.com/2010/07/part-2-developing-proximity-alerts-for-mobile-applications-using-the-android-platform/" target="_blank">Part 2</a>, and <a href="http://blog.brianbuikema.com/2010/07/part-3-developing-proximity-alerts-for-mobile-applications-using-the-android-platform/" target="_blank">Part 3</a>).  Our goal in Parts 1- 3 was to create an Android-based mobile application that demonstrated some basic proximity alert functionality.  And we successfully completed this, but our method of processing proximity alerts was in the foreground, the method of alerting the user was somewhat crude, e.g., vibrate phone and display toast, and the alerts were automatically enabled with no way for the user to control alert enable/disabling.</p>
<h2>Enhancements</h2>
<p>Therefore, we will implement three major enhancements in this post as follows:</p>
<ul>
<li>Process proximity alerts in the background by moving processing to an Android <a href="http://developer.android.com/reference/android/app/Service.html" target="_blank"><em>Service</em></a>.  We will call our service <em>PromityAlertService</em>.</li>
<li>We will use Android&#8217;s built-in <a href="http://developer.android.com/reference/android/app/NotificationManager.html" target="_blank"><em>NotificationManager </em></a>to provide <em>true </em>Android notifications that appear and can be controlled within the status bar.</li>
<li>And we will provide a <em>checkbox </em>in the <em>ProximityAlertSetActivity </em>screen allowing the user to enable/disable alerts anytime.  We will default to <strong>disabled </strong>to ensure that an alert is not fired immediately (since you are standing in the actual proximity of the alert when creating/editing the alert!).</li>
</ul>
<h2>Moving Proximity Alert Detection Processing to the Background by Creating an Android Service</h2>
<p>More coming soon!</p>
<h2>Enhancing Proximity Alert Notifications</h2>
<p>When we add or save a proximity alert, we add the alert to the <a href="http://developer.android.com/reference/android/location/LocationManager.html" target="_blank">LocationManager </a>via our AlertHelper class.  Note:  I have renamed the <em>addProximityAlerts</em>(&#8230;) method we used previously, to <em>addProximityAlertsToLocationManager</em>(&#8230;) to be more precise.  It is within this method that we add a PendingIntent that will perform a broadcast to our <em>ProximityIntentReceiver </em>(you may recall we created the ProximityIntentReceiver in a previous post).</p>
<p>The ProximityAlertHelper&#8217;s addProximityAlertsToLocationManager(&#8230;) method is as follows:</p>
<pre class="brush: java; highlight: [13]; title: ; notranslate">
public boolean addProximityAlertsToLocationManager(Context caller, ArrayList&lt;ProximityAlert&gt; alerts) {
  if (initialized) {
    String context = Context.LOCATION_SERVICE;
    LocationManager mgr = ((LocationManager) caller.getSystemService(context));

    removeAlerts(caller);

    for (int i=1; i &lt;alerts.size(); i++) {
      ProximityAlert alert = alerts.get(i);

      if (alert.Enabled) {
        Intent intent = new Intent(ProximityAlertActivity.class.getName());
        intent.putExtra(&quot;id&quot;, alert.Id);
        PendingIntent proximityIntent = PendingIntent.getBroadcast(caller, i, intent, PendingIntent.FLAG_CANCEL_CURRENT);
        float proxRadius = Float.parseFloat(PreferenceManager.getDefaultSharedPreferences(caller).getString(&quot;proxradius&quot;, &quot;2&quot;));
        mgr.addProximityAlert(alert.Lat, alert.Lng, proxRadius, -1, proximityIntent);
        proximityIntentsMap.put(alert, proximityIntent);
      }
    }
    return true;
  }

  return false;
}
</pre>
<p>Note that we add the alert&#8217;s <strong>id </strong>field to the intent in line 13.  We will use this later to retrieve the alert object upon processing a proximity alert notification event.</p>
<p>Let&#8217;s focus our attention on <em>ProximityIntentReceiver </em>class and discuss one addition to the <em>onReceive</em>(&#8230;) method.  We make our notification request to the NotificationManager here, on line 14, as follows:</p>
<pre class="brush: java; highlight: [10,14]; title: ; notranslate">
public class ProximityIntentReceiver extends BroadcastReceiver implements IDebugSwitch {
  @Override
  public void onReceive(Context context, Intent intent) {
    String key = LocationManager.KEY_PROXIMITY_ENTERING;
    Boolean entering = intent.getBooleanExtra(key, false);

    if (entering) {
      ProximityAlert alert;
      try {
        alert = ProximityAlertHelper.getInstance().getAlert(intent.getExtras().getLong(&quot;id&quot;));

        ArrayList&lt;ProximityAlert&gt; alerts = new ArrayList&lt;ProximityAlert&gt;();
        alerts.add(alert);
        NotifierHelper.sendNotification(context, ProximityAlertActivity.class, alerts);
      }
      catch (Exception ex) {
        Log.e(AppSettings.DEBUG_TAG, &quot;General failure in ProximityIntentReceiver&quot;, ex);
        throw;
      }
    }
  }
}
</pre>
<p>Note, in line 10 the actual event&#8217;s alert object is retrieved using the <strong>id </strong>field we earlier stored in the intent.</p>
<p>And finally, I have created a helper class called <em>NotifierHelper </em>to handle the heavy lifting of adding a notification to the <a href="http://developer.android.com/reference/android/app/NotificationManager.html" target="_blank">NoticationManager </a>as follows:</p>
<pre class="brush: java; title: ; notranslate">
public class NotifierHelper implements IDebugSwitch {
  private static final int NOTIFY_1 = 0x1001;

  public static void sendNotification(Context context, Class&lt;?&gt; activityToLaunch, ArrayList&lt;ProximityAlert&gt; alerts) {
    // String values should be stored in &quot;strings.xml&quot;
    // I show them here for convenience.

    NotificationManager notifier = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

    // Create this outside the button so we can increment the number drawn over the notification icon,
    // indicating the number of alerts for this event.
    final Notification notify = new Notification(R.drawable.android_32, &quot;&quot;, System.currentTimeMillis());

    // Add status bar notification
    notify.icon = R.drawable.android_32;
    notify.tickerText = &quot;Proximo has new Proximity Alerts!&quot;;
    notify.when = System.currentTimeMillis();
    notify.number = alerts.size();
    notify.flags |= Notification.FLAG_AUTO_CANCEL;

    // Add lights
    notify.flags |= Notification.FLAG_SHOW_LIGHTS;
    notify.ledARGB = Color.WHITE;
    notify.ledOnMS = 500;
    notify.ledOffMS = 500;

// Add vibs
    notify.vibrate = new long[] {100, 200, 200, 200, 200, 200, 1000, 200, 200, 200, 1000, 200};

    Intent toLaunch = new Intent(context, activityToLaunch);
    toLaunch.putExtra(&quot;id&quot;, alerts.get(0).Id);
    PendingIntent intentBack = PendingIntent.getActivity(context, 0, toLaunch, 0);

    notify.setLatestEventInfo(context, &quot;Proximity Alerts&quot;, &quot;You have &quot; + alerts.size() + &quot; proximity alerts!&quot;, intentBack);
    notifier.notify(NOTIFY_1, notify);
  }

  public static void clear(Activity caller) {
    NotificationManager notifier = (NotificationManager) caller.getSystemService(Context.NOTIFICATION_SERVICE);
    notifier.cancelAll();
  }
}
</pre>
<h2>Providing the Ability to Enable and Disable Proximity Alerts</h2>
<p>Enabling and disabling proximity alerts is a fundamental feature that must not be overlooked.  Let&#8217;s first update the ProximityAlert entity to define an <em>Enabled </em>field.  The updates to the class are as follows:</p>
<pre class="brush: java; highlight: [13,16,25,29,47,73]; title: ; notranslate">
public class ProximityAlert extends BaseEntity&lt;ProximityAlert&gt; {
  private static long nextId = 0;
  public long Id = -1;
  public double Lat = 0;
  public double Lng = 0;
  public String Name = &quot;&quot;;
  public String Desc = &quot;&quot;;
  public String Expiration = &quot;&quot;;
  public int Month = -1;
  public int DayOfMonth = -1;
  public int Year = -1;
  public ArrayList&lt;String&gt; Items = new ArrayList&lt;String&gt;();
  public boolean Enabled = false;
  public boolean IsNew = true;

  public ProximityAlert(long id, double lat, double lng, String name, String desc, int month, int dayOfMonth, int year, boolean enabled) {
    this.Lat = lat;
    this.Lng = lng;
    this.Id = id;
    this.Name = name;
    this.Desc = desc;
    this.Month = month;
    this.DayOfMonth = dayOfMonth;
    this.Year = year;
    this.Enabled = enabled;
  }

  public ProximityAlert(double lat, double lng, String name, String desc, int month, int dayOfMonth, int year, boolean enabled) {
    this(nextId++, lat, lng, name,  desc, month, dayOfMonth, year, enabled);
  }

  public ProximityAlert(long id, String name, String desc) {
    this(id, 0.0, 0.0, name, desc, Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DAY_OF_MONTH), Calendar.getInstance().get(Calendar.YEAR), false);
  }

  public JSONObject serializeToObj() {
    JSONObject serializedObj = new JSONObject();
    try {
      serializedObj.put(&quot;Id&quot;, this.Id);
      serializedObj.put(&quot;Lat&quot;, this.Lat);
      serializedObj.put(&quot;Lng&quot;, this.Lng);
      serializedObj.put(&quot;Name&quot;, this.Name);
      serializedObj.put(&quot;Desc&quot;, this.Desc);
      serializedObj.put(&quot;Month&quot;, this.Month);
      serializedObj.put(&quot;DayOfMonth&quot;, this.DayOfMonth);
      serializedObj.put(&quot;Year&quot;, this.Year);
      serializedObj.put(&quot;Enabled&quot;, this.Enabled);

      ArrayList&lt;JSONObject&gt; itemObjs = new ArrayList&lt;JSONObject&gt;();
      for (String item:this.Items) {
        JSONObject serializedItemObj = new JSONObject();
        serializedItemObj.put(&quot;Item&quot;, item);
        itemObjs.add(serializedItemObj);
      }
      serializedObj.put(&quot;Items&quot;, new JSONArray(itemObjs));
    }
    catch(Exception ex) {
      if (debug) Log.e(AppSettings.DEBUG_TAG, ex.getMessage(), ex);
    }

    return serializedObj;
  }

  public ProximityAlert deserializeFromObj(JSONObject obj) throws JSONException {
    this.Id = obj.getLong(&quot;Id&quot;);
    this.Lat = obj.getDouble(&quot;Lat&quot;);
    this.Lng = obj.getDouble(&quot;Lng&quot;);
    this.Name = obj.getString(&quot;Name&quot;);
    this.Desc = obj.getString(&quot;Desc&quot;);
    this.Month = obj.getInt(&quot;Month&quot;);
    this.DayOfMonth = obj.getInt(&quot;DayOfMonth&quot;);
    this.Year = obj.getInt(&quot;Year&quot;);
    this.Enabled = obj.getBoolean(&quot;Enabled&quot;);

    if (obj.has(&quot;Items&quot;)) {
      JSONArray jsonObjs = obj.getJSONArray(&quot;Items&quot;);
      this.Items = new ArrayList&lt;String&gt;(jsonObjs.length());
      for (int i=0; i&lt;jsonObjs.length(); i++) {
        JSONObject itemObj = jsonObjs.getJSONObject(i);
        this.Items.add(itemObj.getString(&quot;Item&quot;));
      }
    }

    return this;
  }
}
</pre>
<p>The <strong>highlighted</strong> lines above represent the changes required to support the <em>Enabled </em>field.</p>
<p>Now we take a look at how the <em>Enabled </em>field is used within the ProximityAlertHelper&#8217;s <em>addProximityAlertsToLocationManager</em>(&#8230;) method.  Line 9 below now requires that the alert be <em>enabled </em>before adding it to the LocationManager.</p>
<pre class="brush: java; highlight: [11]; title: ; notranslate">
public boolean addProximityAlertsToLocationManager(Context caller, ArrayList&lt;ProximityAlert&gt; alerts) {
  if (initialized) {
    String context = Context.LOCATION_SERVICE;
    LocationManager mgr = ((LocationManager) caller.getSystemService(context));

    removeAlerts(caller);

    for (int i=1; i &lt;alerts.size(); i++) {
      ProximityAlert alert = alerts.get(i);

      if (alert.Enabled) {
        Intent intent = new Intent(ProximityAlertActivity.class.getName());
        intent.putExtra(&quot;id&quot;, alert.Id);
        PendingIntent proximityIntent = PendingIntent.getBroadcast(caller, i, intent, PendingIntent.FLAG_CANCEL_CURRENT);
        float proxRadius = Float.parseFloat(PreferenceManager.getDefaultSharedPreferences(caller).getString(&quot;proxradius&quot;, &quot;2&quot;));
        mgr.addProximityAlert(alert.Lat, alert.Lng, proxRadius, -1, proximityIntent);
        proximityIntentsMap.put(alert, proximityIntent);
      }
    }
    return true;
  }

  return false;
}
</pre>
<p>And lastly, let&#8217;s see the actual <em>enabled </em>field within the <em>ProximityAlertSetActivity </em>screen.</p>
<div id="attachment_1058" class="wp-caption aligncenter" style="width: 335px"><a href="http://blog.brianbuikema.com/wp-content/uploads/2010/07/AdditionOfEnabledField.jpg"><img class="size-full wp-image-1058" title="Addition of Enabled Field into ProximityAlertSetActivity Screen" src="http://blog.brianbuikema.com/wp-content/uploads/2010/07/AdditionOfEnabledField.jpg" alt="Addition of Enabled Field into ProximityAlertSetActivity Screen" width="325" height="431" /></a><p class="wp-caption-text">Addition of Enabled Field into ProximityAlertSetActivity Screen</p></div>
<p>Note that the details of integrating the enabled field into the application are straightforward, and begin as follows:</p>
<pre class="brush: java; title: ; notranslate">
boolean enabled = ((CheckBox) findViewById(R.id.CheckBox_alert_enabled)).isChecked();
</pre>
<p>I hope this discussion of enhancements to the Proximity Alert Mobile Application helps extend your understanding of how to properly build proximity alert applications using the Android platform.</p>
<p>I look forward to discussing new mobile development concepts in my next post!  Please come back soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianbuikema.com/2010/07/part-4-developing-proximity-alerts-for-mobile-applications-using-the-android-platform/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Surviving the Security Tools Virus</title>
		<link>http://blog.brianbuikema.com/2010/03/surviving-the-security-tools-virus/</link>
		<comments>http://blog.brianbuikema.com/2010/03/surviving-the-security-tools-virus/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 17:56:33 +0000</pubDate>
		<dc:creator>Brian Buikema</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Virus]]></category>
		<category><![CDATA[malware]]></category>

		<guid isPermaLink="false">http://blog.brianbuikema.com/?p=131</guid>
		<description><![CDATA[Last weekend while as I was getting ready to crank some code, a disturbing dialog popped up on my laptop.  I knew this was bad.  The good thing was that this virus did a lot to identify itself, with the repeated dialogs&#8230; This article helped me immensely, and I thank those guys a lot.  http://www.bleepingcomputer.com/virus-removal/remove-security-tool.  [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend while as I was getting ready to crank some code, a disturbing dialog popped up on my laptop.  I knew this was bad.  The good thing was that this virus did a lot to identify itself, with the repeated dialogs&#8230;</p>
<p>This article helped me immensely, and I thank those guys a lot.  <a href="http://www.bleepingcomputer.com/virus-removal/remove-security-tool">http://www.bleepingcomputer.com/virus-removal/remove-security-tool</a>.  I followed their steps, but had to try several times to successfully run a recommended batch file designed to kill all malicious processes.  Without successfully completing this, you will never rid yourself of the virus.</p>
<p>I finally got through it, and the subsequent steps were easy to complete.  Note that it takes 2-3 hours to run an app designed to identify all malicious files on your hardrive.  Once the task is done, you simply click a button to delete them and viola, you are clean again!</p>
<p><a href="http://www.malwarebytes.org/" target="_blank">I want to add this link to Malwarebytes, the malware detection and removal software I now run on my computers</a>.  It is extremely cheap, great at what it does, and <em>does not act like a virus itself</em>, like some other malware detection and removal products.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianbuikema.com/2010/03/surviving-the-security-tools-virus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
