<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3419415261135769428</id><updated>2011-12-05T13:03:53.335-08:00</updated><category term='cnbc'/><category term='maven aspectj android java jexl'/><category term='java'/><category term='Android sqlite'/><category term='collaboration'/><category term='android generics request http'/><title type='text'>.. thoughts ..</title><subtitle type='html'>contemplations of the moment and technology</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-7893777864035696334</id><published>2011-12-05T12:59:00.001-08:00</published><updated>2011-12-05T13:03:30.769-08:00</updated><title type='text'>organization</title><content type='html'>Many believe that the organization of your house reflects the level turmoil of your being.  I believe this to be very true which is why tonight I clean.  Along side this I also believe the same for thought.  The more methodical a person is in forming opinion/strategy, the more defined the outcome and probable of being successful.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;In the software arena it is ever important to anticipate your next step as it is in every aspect of our lives has human beings.  If we can't / won't anticipate where we will be standing next then how can we intend to get there - even if where we anticipate to be standing is not exactly correct ... it's the journey not the destination I suppose.  Like all things in life people have the tendency to remember the last bad thing that you did versus, the more optimistic, last good thing you did .. and hopefully it was more recent.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-7893777864035696334?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/7893777864035696334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=7893777864035696334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/7893777864035696334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/7893777864035696334'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2011/12/organization.html' title='organization'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-6948703264985589299</id><published>2011-05-19T20:14:00.000-07:00</published><updated>2011-05-19T20:14:25.980-07:00</updated><title type='text'>freemarker</title><content type='html'>Two things.  &lt;br /&gt;&lt;br /&gt;1) Find a concern across many problems that you can standardize with sufficient metadata to drive an algorithm.&lt;br /&gt;2) Use freemarker to standardize the code generation and save yourself a lot of time.&lt;br /&gt;&lt;br /&gt;I recently did this by extending the hibernate-tools suite and the hibernate3-maven-plugin to give my organization what it needs -- well, part of what it needs -- a data access layer code generator that takes it to the next level.  Generics, AOP  and pseudo-partial classes.  This solidifies the pattern and practice and is extremely extensible not to mention it slims down the application code drastically and development timelines.  &lt;br /&gt;&lt;br /&gt;There are a ton of code generation strategies but I'm a firm believe in the power of decoupling at the interface and not binding yourself to an implementation.  With that said this generation code generates an injectable/autowireable manager, dao interfaces that extend a generic definition, genericized jpa implementations that extend an implementation specific generic dao (that happens to implement the same aforementioned dao interface as well).&lt;br /&gt;&lt;br /&gt;If you have questions or need help with such things drop me a line.  I'm more than willing to help especially considering the hibernate-tools code is not well documented nor is the context information passed into freemarker.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-6948703264985589299?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/6948703264985589299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=6948703264985589299' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/6948703264985589299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/6948703264985589299'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2011/05/freemarker.html' title='freemarker'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-1228533072984394623</id><published>2011-04-21T08:31:00.000-07:00</published><updated>2011-04-21T08:31:28.828-07:00</updated><title type='text'>Loathe, Like, Love.: Loathe of the day...Ai WeiWei's Latest Predicament...</title><content type='html'>&lt;a href="http://loathelikelove.blogspot.com/2010/11/loathe-of-dayai-weiweis-latest.html?spref=bl"&gt;Loathe, Like, Love.: Loathe of the day...Ai WeiWei&amp;#39;s Latest Predicament...&lt;/a&gt;: "Ai WeiWei's Template    Grapes     Chandelier, 2002    Cube Light     Forever Bicycles      The artist/activist.  I hate to get political w..."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-1228533072984394623?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://loathelikelove.blogspot.com/2010/11/loathe-of-dayai-weiweis-latest.html?spref=bl' title='Loathe, Like, Love.: Loathe of the day...Ai WeiWei&apos;s Latest Predicament...'/><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/1228533072984394623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=1228533072984394623' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1228533072984394623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1228533072984394623'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2011/04/loathe-like-love-loathe-of-dayai.html' title='Loathe, Like, Love.: Loathe of the day...Ai WeiWei&apos;s Latest Predicament...'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-6985541952710560919</id><published>2011-04-19T21:57:00.000-07:00</published><updated>2011-04-21T06:34:01.215-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='maven aspectj android java jexl'/><title type='text'>android and aspect oriented programming (aop)</title><content type='html'>When OOP appeared in the software world it was pioneering.  Encapsulation!  Abstraction! OOP became the next big thing and it's still huge.  OOP is great; you can define an ontology and build out what the grammar of whatever your layer/application is.  It's fantastic.  But there are simply some things that don't really belong to an object.  We'll call these &lt;i&gt;cross-cutting concerns&lt;/i&gt;.  These concerns are pervasive throughout an application (i.e. transaction registration, CRM auditing) and typically functional.  Enter AOP (aspect oriented programming) brought to us some years ago by the guys at Xerox PARC.  Some will say it's made things a lot easier, some would say &lt;i&gt;I have no clue what is going on&lt;/i&gt;.  AOP compliments OOP very well.  Some will say that you can do the same with well defined interfaces or abstracts BUT that truly does require dead accuracy basically the first time, can cause drastic issues if refactoring is needed and simply can clutter your code.  AOP is a new(er) strategy for modularization.  Note: another good one is the decorator pattern.&lt;br /&gt;&lt;br /&gt;Getting back to it.  I've used many AOP technologies and am currently using AspectJ rather frequently in lower level framework development.  Making some concerns declarative via an annotation, or simply flat out applied to all methods (i.e. tracing, execution auditing), for some reason makes it a lot easier to understand.  Hide the magic.  &lt;br /&gt;&lt;br /&gt;Recently I've begun doing a significant amount of Android development across many products and have thought to myself &lt;i&gt;Can I get AOP to work on the Dalvik VM?&lt;/i&gt;.  Well, the answer is &lt;i&gt;yes&lt;/i&gt;.  Largely I've had a desire to do this b/c I lead a group of developers and unifying a development process always comes from the bottom up.  This guarantees adherence to pattern and convention above and beyond coding standards and promotes a massive amount of re-use.  This very important for making sure certain concerns are addressed in the same fashion (i.e. exception handling).  &lt;br /&gt;&lt;br /&gt;Granted AOP has taken off in certain areas and has not in others the challenge of introducing advice into Android code was a challenging one up front but not insurmountable.  The reason being for this is that the first building block of Android is a Java development environment and the Java &lt;i&gt;class&lt;/i&gt; byte code format.  The next stage, after development, is the packaging of these java class files into the Dalvik Executable format (DEX).  Unfortunately advice cannot be applied directly to DEX files b/c currently the Android runtime lacks a byte code generation scheme where Java supports several forms of advice introduction:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;compile time -- byte code manipulation.&lt;/li&gt;&lt;li&gt;load time -- byte code manipulation.  Has a slower startup time.&lt;/li&gt;&lt;li&gt;run time -- auto-proxies of various forms (an is-a relationship) or jdk interceptors (Spring for example can work in both of these paradigms but it is fundamentally the slowest).&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;With that said applying advice to an Android app, due to the lack byte code generation schemes, is &lt;i&gt;option 1&lt;/i&gt;.  With this we can write java code and compile aspects directly into it and finally convert it to the DEX format to run on android devices.&lt;br /&gt;&lt;br /&gt;One thing to &lt;b&gt;note&lt;/b&gt; about DEX is that it &lt;i&gt;unpacks&lt;/i&gt; all jar files and packages all dependent classes into a single zip archive, classes.dex.  This could be because of several historical reasons:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;J2ME has proven to have issues in the past with class loaders and and a large number of classes.&lt;/li&gt;&lt;li&gt;not having the byte code in the java format mitigates the need for the OEM to have to pay Sun / J2ME licensing fees.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;A bit of history....&lt;br /&gt;&lt;br /&gt;Let's get back to it.&lt;br /&gt;&lt;br /&gt;I'm a firm believer in logical architecture where your libraries represent modularized concerns.  With that said I also like to create aspects that sit at a lower level or at that of an API.  This can be done generally via abstract pointcut definitions to allow the application to define the fully qualified pointcut definition but the same advice is applied; or, by proceeding in a declarative fashion.  This is great b/c it engages the developer and removes the need for them to understand pointcut definitions.&lt;br /&gt;&lt;br /&gt;So, considering this, let's create a Java project in maven with an aspect to be applied to another module.  We'll call it &lt;i&gt;android.aop&lt;/i&gt;.  The following is a boiled down maven build script for the android.aop project:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&amp;gt;&lt;br /&gt; &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;&lt;br /&gt; &amp;lt;groupId&amp;gt;some.group&amp;lt;/groupId&amp;gt;&lt;br /&gt; &amp;lt;artifactId&amp;gt;android.aop&amp;lt;/artifactId&amp;gt;&lt;br /&gt; &amp;lt;version&amp;gt;1.0.0&amp;lt;/version&amp;gt;&lt;br /&gt; &amp;lt;packaging&amp;gt;jar&amp;lt;/packaging&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;dependencies&amp;gt;&lt;br /&gt;  &amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;com.google.android&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;android&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;2.2.1&amp;lt;/version&amp;gt;&lt;br /&gt;   &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;  &amp;lt;/dependency&amp;gt;&lt;br /&gt;  &amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;org.aspectj&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;aspectjrt&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.6.10&amp;lt;/version&amp;gt;&lt;br /&gt;   &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;   &amp;lt;optional&amp;gt;false&amp;lt;/optional&amp;gt;&lt;br /&gt;  &amp;lt;/dependency&amp;gt;&lt;br /&gt;  &amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;org.aspectj&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;aspectjweaver&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.6.10&amp;lt;/version&amp;gt;&lt;br /&gt;   &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;   &amp;lt;optional&amp;gt;false&amp;lt;/optional&amp;gt;&lt;br /&gt;  &amp;lt;/dependency&amp;gt;&lt;br /&gt;  &amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;org.aspectj&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;aspectjtools&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.6.10&amp;lt;/version&amp;gt;&lt;br /&gt;   &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;  &amp;lt;/dependency&amp;gt;&lt;br /&gt; &amp;lt;/dependencies&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;build&amp;gt;&lt;br /&gt;  &amp;lt;plugins&amp;gt;&lt;br /&gt;   &amp;lt;plugin&amp;gt;&lt;br /&gt;    &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;aspectj-maven-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;1.3.1&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;configuration&amp;gt;&lt;br /&gt;     &amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;&lt;br /&gt;     &amp;lt;complianceLevel&amp;gt;1.5&amp;lt;/complianceLevel&amp;gt;&lt;br /&gt;     &amp;lt;showWeaveInfo&amp;gt;true&amp;lt;/showWeaveInfo&amp;gt;&lt;br /&gt;     &amp;lt;verbose&amp;gt;true&amp;lt;/verbose&amp;gt;&lt;br /&gt;    &amp;lt;/configuration&amp;gt;&lt;br /&gt;    &amp;lt;executions&amp;gt;&lt;br /&gt;     &amp;lt;execution&amp;gt;&lt;br /&gt;      &amp;lt;goals&amp;gt;&lt;br /&gt;       &amp;lt;goal&amp;gt;compile&amp;lt;/goal&amp;gt;&lt;br /&gt;      &amp;lt;/goals&amp;gt;&lt;br /&gt;     &amp;lt;/execution&amp;gt;&lt;br /&gt;    &amp;lt;/executions&amp;gt;&lt;br /&gt;   &amp;lt;/plugin&amp;gt;&lt;br /&gt;   &amp;lt;plugin&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;2.3.2&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;configuration&amp;gt;&lt;br /&gt;     &amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;&lt;br /&gt;     &amp;lt;target&amp;gt;1.5&amp;lt;/target&amp;gt;&lt;br /&gt;    &amp;lt;/configuration&amp;gt;&lt;br /&gt;   &amp;lt;/plugin&amp;gt;&lt;br /&gt;  &amp;lt;/plugins&amp;gt;&lt;br /&gt; &amp;lt;/build&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;i&gt; The maven-aspectj-plugin will look for aspects beneath src/main/aspect. &lt;br /&gt;&lt;br /&gt;An android apk maven build script (boiled down of course):&lt;br /&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&amp;gt;&lt;br /&gt; &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;&lt;br /&gt; &amp;lt;groupId&amp;gt;some.other.group&amp;lt;/groupId&amp;gt;&lt;br /&gt; &amp;lt;artifactId&amp;gt;android.apk&amp;lt;/artifactId&amp;gt;&lt;br /&gt; &amp;lt;version&amp;gt;1.0.0&amp;lt;/version&amp;gt;&lt;br /&gt; &amp;lt;packaging&amp;gt;apk&amp;lt;/packaging&amp;gt; &lt;br /&gt;&lt;br /&gt; &amp;lt;dependencies&amp;gt;&lt;br /&gt;  &amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;com.google.android&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;android&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;2.2.1&amp;lt;/version&amp;gt;&lt;br /&gt;   &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;  &amp;lt;/dependency&amp;gt;&lt;br /&gt;  &amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;some.group&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;android.aop&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.0.0&amp;lt;/version&amp;gt;&lt;br /&gt;   &amp;lt;type&amp;gt;jar&amp;lt;/type&amp;gt;&lt;br /&gt;   &amp;lt;scope&amp;gt;compile&amp;lt;/scope&amp;gt;&lt;br /&gt;  &amp;lt;/dependency&amp;gt;&lt;br /&gt;  &amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;org.aspectj&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;aspectjrt&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.6.9&amp;lt;/version&amp;gt;&lt;br /&gt;  &amp;lt;/dependency&amp;gt;&lt;br /&gt;  &amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;org.aspectj&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;aspectjtools&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.6.10&amp;lt;/version&amp;gt;&lt;br /&gt;   &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;  &amp;lt;/dependency&amp;gt;&lt;br /&gt; &amp;lt;/dependencies&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;build&amp;gt;&lt;br /&gt;  &amp;lt;plugins&amp;gt;&lt;br /&gt;   &amp;lt;plugin&amp;gt;&lt;br /&gt;    &amp;lt;groupId&amp;gt;com.jayway.maven.plugins.android.generation2&amp;lt;/groupId&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;maven-android-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;2.8.4&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;configuration&amp;gt;&lt;br /&gt;     &amp;lt;sdk&amp;gt;&lt;br /&gt;      &amp;lt;platform&amp;gt;2.1&amp;lt;/platform&amp;gt;&lt;br /&gt;     &amp;lt;/sdk&amp;gt;&lt;br /&gt;     &amp;lt;extractDuplicates&amp;gt;true&amp;lt;/extractDuplicates&amp;gt;&lt;br /&gt;     &amp;lt;undeployBeforeDeploy&amp;gt;true&amp;lt;/undeployBeforeDeploy&amp;gt;&lt;br /&gt;    &amp;lt;/configuration&amp;gt;&lt;br /&gt;    &amp;lt;extensions&amp;gt;true&amp;lt;/extensions&amp;gt;&lt;br /&gt;   &amp;lt;/plugin&amp;gt;&lt;br /&gt;   &amp;lt;plugin&amp;gt;&lt;br /&gt;    &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;aspectj-maven-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;1.3.1&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;configuration&amp;gt;&lt;br /&gt;     &amp;lt;argumentFileName&amp;gt;trace.lst&amp;lt;/argumentFileName&amp;gt;&lt;br /&gt;     &amp;lt;aspectLibraries&amp;gt;&lt;br /&gt;      &amp;lt;aspectLibrary&amp;gt;&lt;br /&gt;       &amp;lt;groupId&amp;gt;some.group&amp;lt;/groupId&amp;gt;&lt;br /&gt;       &amp;lt;artifactId&amp;gt;android.aop&amp;lt;/artifactId&amp;gt;&lt;br /&gt;      &amp;lt;/aspectLibrary&amp;gt;&lt;br /&gt;     &amp;lt;/aspectLibraries&amp;gt;&lt;br /&gt;     &amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;&lt;br /&gt;     &amp;lt;complianceLevel&amp;gt;1.5&amp;lt;/complianceLevel&amp;gt;&lt;br /&gt;     &amp;lt;showWeaveInfo&amp;gt;true&amp;lt;/showWeaveInfo&amp;gt;&lt;br /&gt;     &amp;lt;verbose&amp;gt;true&amp;lt;/verbose&amp;gt;&lt;br /&gt;    &amp;lt;/configuration&amp;gt;&lt;br /&gt;    &amp;lt;executions&amp;gt;&lt;br /&gt;     &amp;lt;execution&amp;gt;&lt;br /&gt;      &amp;lt;goals&amp;gt;&lt;br /&gt;       &amp;lt;goal&amp;gt;compile&amp;lt;/goal&amp;gt;&lt;br /&gt;      &amp;lt;/goals&amp;gt;&lt;br /&gt;     &amp;lt;/execution&amp;gt;&lt;br /&gt;    &amp;lt;/executions&amp;gt;&lt;br /&gt;   &amp;lt;/plugin&amp;gt;&lt;br /&gt;   &amp;lt;plugin&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;2.3.2&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;configuration&amp;gt;&lt;br /&gt;     &amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;&lt;br /&gt;     &amp;lt;target&amp;gt;1.5&amp;lt;/target&amp;gt;&lt;br /&gt;    &amp;lt;/configuration&amp;gt;&lt;br /&gt;   &amp;lt;/plugin&amp;gt;&lt;br /&gt;  &amp;lt;/plugins&amp;gt;&lt;br /&gt; &amp;lt;/build&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Now that the build rigmarole is out of the way you can focus on aspect development.  For instance, a declarative approach to audit use case execution perhaps.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;/**&lt;br /&gt; * An annotation to be applied to methods of which we would like to track their execution&lt;br /&gt; * (i.e) createAccount&lt;br /&gt; */&lt;br /&gt;public @interface Tracked {&lt;br /&gt;&lt;br /&gt; // add in whatever you need to track &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The example skeleton aspect that handles the hitting of the method:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;@Aspect&lt;br /&gt;public class TrackingAspect {&lt;br /&gt;&lt;br /&gt; @AfterReturning(value = "execution(* *(..)) &amp;amp;&amp;amp; @annotation(tracked)", argNames = "joinPoint, tracked")&lt;br /&gt; public void track(JoinPoint joinPoint, Tracked tracked) {&lt;br /&gt;  // whatever your tracking logic may be. &lt;br /&gt;  // The JoinPoint injection is only added with an execution pointcut is defined.&lt;br /&gt;  // the tracked is passed in as an arg on the join point&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;These two classes would end up in your &lt;i&gt;android.aop&lt;/i&gt; jar and would allow for some bit of functionality to occur within your application whenever a method decorated with the @Tracked annotation appears.  These annotations don't necessarily need to have a Runtime retention policy b/c we are actually applying the advice at compile time.  If the Dalvik VM supported load time weaving (had a byte code generation scheme) you could leverage a Runtime retention policy.&lt;br /&gt;&lt;br /&gt;Another that I've found useful with various declarative advice applications is leveraging JEXL (Java expression language) to pass runtime metadata to the interwoven advice via the call stack ... but we'll leave that for another post.&lt;br /&gt;&lt;br /&gt;At any rate, that's the high and low of it.  Much thanks to Nikhil Walvekar (  &lt;a href="http://code.google.com/p/android-aspectj/"&gt;published an example of aspectj method tracing in Android&lt;/a&gt; ) for his assistance with helping me figure out a modular build in maven.  &lt;br /&gt;&lt;br /&gt;If you have questions don't hesitate to email me.&lt;br /&gt;&lt;br /&gt;dan&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-6985541952710560919?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/6985541952710560919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=6985541952710560919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/6985541952710560919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/6985541952710560919'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2011/04/android-and-aspect-oriented-programming.html' title='android and aspect oriented programming (aop)'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-1660728233625246782</id><published>2011-04-14T06:37:00.000-07:00</published><updated>2011-04-14T06:37:29.399-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android generics request http'/><title type='text'>Android and a GenericizedRequest structure</title><content type='html'>One thing that I've noticed as of late as that there Android &lt;b&gt;does&lt;/b&gt; have a great capacity for asynchronous processing via adapters to java.lang.Thread.  However, I've found that when developing domain libraries it's best to hide as much of the synchronicity from the consuming developer to &lt;br /&gt;a) standardized&lt;br /&gt;b) simply&lt;br /&gt;&lt;br /&gt;By providing a synchronous and asynchronous call you provide flexibility in how the API is consumed.  AND you can guarantee to lighten the load of development by the integration developer.  I'll create a standardized API that exposes to execute methods that derived off of a generic class which encapsulates the AsyncTask structure for say http calls if that is what you're wanting to hide.  By doing this the API becomes very light, consistent and reusable across applications.&lt;br /&gt;&lt;br /&gt;Callback is the key for onPost AsyncTask functionality.  Will allow the dev to encapsulate as a reusable anonymous inner class.&lt;br /&gt;&lt;pre&gt;public abstract class Callback&lt;T&gt; {&lt;br /&gt; &lt;br /&gt; Object caller;&lt;br /&gt; &lt;br /&gt; Context context;&lt;br /&gt; &lt;br /&gt; public Callback(Object sender, Context context) {&lt;br /&gt;  this.caller = sender;&lt;br /&gt;  this.context = context;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public Object getSender() {&lt;br /&gt;  return caller;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public final void handle(T response, Object... params) {&lt;br /&gt;  doCallback(this.caller, response, params);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * The callback template&lt;br /&gt;  * &lt;br /&gt;  * @param sender&lt;br /&gt;  *            the activity that sent the request&lt;br /&gt;  * @param response&lt;br /&gt;  *            the response of T&lt;br /&gt;  * @param params&lt;br /&gt;  *            the input stack&lt;br /&gt;  */&lt;br /&gt; protected abstract void doCallback(Object sender, T response, Object... params);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;GenericRequest&lt;T&gt;:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public abstract class GenericRequest&lt;T&gt; {&lt;br /&gt;&lt;br /&gt; private static final String TAG = "GenericRequest";&lt;br /&gt;&lt;br /&gt; protected HttpRequest requestor;&lt;br /&gt;&lt;br /&gt; protected String url;&lt;br /&gt;&lt;br /&gt; public GenericRequest() {&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public GenericRequest(HttpRequest requestor, String url) {&lt;br /&gt;  this.requestor = requestor;&lt;br /&gt;  this.url = url;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Will make the request in a synchronous fashion&lt;br /&gt;  * &lt;br /&gt;  * @return&lt;br /&gt;  * @throws Exception&lt;br /&gt;  */&lt;br /&gt; public T execute() throws Exception {&lt;br /&gt;  assert url != null;&lt;br /&gt;  assert requestor != null;&lt;br /&gt;  requestor.makeRequest(url);&lt;br /&gt;  String offTheWire = requestor.getStringResponse();&lt;br /&gt;  return parseResponse(offTheWire);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Will invoke an request as an AsyncTask on a thread and the&lt;br /&gt;  * {@link Callback} will be invoked at the end of the execution cycle&lt;br /&gt;  * &lt;br /&gt;  * @param callback&lt;br /&gt;  *            the callback functionality to be made&lt;br /&gt;  * @throws Exception&lt;br /&gt;  *             any exception&lt;br /&gt;  */&lt;br /&gt; public void execute(Callback&lt;T&gt; callback) throws Exception {&lt;br /&gt;  Log.d(TAG, "executing(..)");&lt;br /&gt;  if (callback != null) {&lt;br /&gt;   CallingAsyncTask caller = new CallingAsyncTask(callback);&lt;br /&gt;&lt;br /&gt;   caller.execute(url);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; protected abstract T parseResponse(String httpResponse);&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * An inner class to handle AsyncTasks for {@link HttpRequest} if a&lt;br /&gt;  * {@link Callback} method is passed to an&lt;br /&gt;  * {@link GenericRequest#execute(Callback)}&lt;br /&gt;  * &lt;br /&gt;  * @author &lt;a href="mailto:dan.williams@nbcuni.com"&gt;Daniel Williams&lt;/a&gt;&lt;br /&gt;  * &lt;br /&gt;  */&lt;br /&gt; class CallingAsyncTask extends AsyncTask&lt;String, Void, T&gt; {&lt;br /&gt;&lt;br /&gt;  static final String TAG = "CallingAsyncTask";&lt;br /&gt;&lt;br /&gt;  Callback&lt;T&gt; callback;&lt;br /&gt;&lt;br /&gt;  String url;&lt;br /&gt;&lt;br /&gt;  public CallingAsyncTask(Callback&lt;T&gt; callback) {&lt;br /&gt;   this.callback = callback;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * Will execute a single URL and invoke the parent's&lt;br /&gt;   * {@link GenericRequest#parseResponse(String)} method.&lt;br /&gt;   * &lt;p&gt;   * This method by default will return java.lang.Void as we are&lt;br /&gt;   * leveraging the Callback&lt;T&gt; to handle the return to the caller.&lt;br /&gt;   */&lt;br /&gt;  @Override&lt;br /&gt;  protected T doInBackground(String... params) {&lt;br /&gt;&lt;br /&gt;   Log.d(TAG, "doInBackground");&lt;br /&gt;&lt;br /&gt;   T response = null;&lt;br /&gt;&lt;br /&gt;   if (params == null || params.length &gt; 1 || params.length == 0)&lt;br /&gt;    throw new RuntimeException("Must handle a single URL.");&lt;br /&gt;   else&lt;br /&gt;    this.url = params[0];&lt;br /&gt;&lt;br /&gt;   try {&lt;br /&gt;    Log.d(TAG, "Requesting " + params[0]);&lt;br /&gt;&lt;br /&gt;    requestor.makeRequest(new HttpGet(params[0]));&lt;br /&gt;&lt;br /&gt;    Log.d(TAG, "request completed.");&lt;br /&gt;   } catch (Exception e) {&lt;br /&gt;    Log.d(TAG, e.getMessage());&lt;br /&gt;    throw new RuntimeException(e.getMessage(), e);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   response = parseResponse(requestor.getStringResponse());&lt;br /&gt;&lt;br /&gt;   Log.d(TAG, "doInBackground complete");&lt;br /&gt;&lt;br /&gt;   return response;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  @Override&lt;br /&gt;  protected void onPostExecute(T result) {&lt;br /&gt;   Log.d(TAG, "onPostExecute");&lt;br /&gt;&lt;br /&gt;   callback.handle(result, url);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And the API Request class:&lt;br /&gt;&lt;pre&gt;public class Request extends GenericRequest&lt;Response&gt; {&lt;br /&gt;&lt;br /&gt; public Request() {&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;  * Will by default call the parent&lt;br /&gt;  * @param requestor&lt;br /&gt;  * @param url&lt;br /&gt;  */&lt;br /&gt; public Request(HttpRequest requestor, String url) {&lt;br /&gt;  super(requestor, url);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /* (non-Javadoc)&lt;br /&gt;  * @see com.nbc.cnbc.android.GenericRequest#parseResponse(java.lang.String)&lt;br /&gt;  */&lt;br /&gt; @Override&lt;br /&gt; protected Response parseResponse(String httpResponse) {&lt;br /&gt;      // parse your httpResponse&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;By solidifying this pattern via templates, anonymous inner classes for Callbacks and encapsulated AsyncTasks your API can be easily executed as:&lt;br /&gt;&lt;br /&gt;// synchronously&lt;br /&gt;&lt;pre&gt;Request r = new Request(new HttpRequest(), "http://www.google.com");&lt;br /&gt;Response response = r.execute();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;// or Asynchronously&lt;br /&gt;&lt;pre&gt;Request r = new Request(new HttpRequest(), "http://www.google.com");&lt;br /&gt;Response response = r.execute(new Callback&lt;Response&gt;(this, this)( {&lt;br /&gt;    @Override&lt;br /&gt;    public void doCallback(Object sender, Response response, Object... params) ({&lt;br /&gt;         this.context.......&lt;br /&gt;         this.sender.notify();&lt;br /&gt;      });&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-1660728233625246782?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/1660728233625246782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=1660728233625246782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1660728233625246782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1660728233625246782'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2011/04/android-and-genericizedrequest.html' title='Android and a GenericizedRequest structure'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-1460338494150242045</id><published>2011-04-12T11:26:00.000-07:00</published><updated>2011-04-14T06:17:32.298-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android sqlite'/><title type='text'>Android persistence framework</title><content type='html'>Lately I've been doing a large amount of development work on the Android platform and have found with as many things standardizing at a lower level is a great way to enforce a concern.  One of the things I've noticed is that many people have a difficult time dealing with entity relationships as well as the sqlite database in general.  So, what I did was develop a genericized DAO structure as well as introduce a dao manager that can be grown by the applicaiton.&lt;br /&gt;&lt;br /&gt;Unfortunately this strategy has a few limitations.  &lt;br /&gt;1) The sqlite api in Android does not support a datatype retrieval mechanism as does JDBC&lt;br /&gt;2) There are a few tweaks that still need to occur in this to support CLOB and BLOB formats&lt;br /&gt;3) The foreign key / entity relationship mapping still needs some work done on it for lazy loading&lt;br /&gt;3) ... and some other random things&lt;br /&gt;&lt;br /&gt;The basic grammar is simple.&lt;br /&gt;&lt;br /&gt;An Entity has a Dao&lt;br /&gt;An Entity has an ID which is a java.lang.Long&lt;br /&gt;An Entity is persistable (save and delete)&lt;br /&gt;An Entity can have relationships to other entities.&lt;br /&gt;An Entity can be derived and its DAO can be derived as well.&lt;br /&gt;&lt;br /&gt;Largely this is a light weight implementation of JPA for Android to simplify database persistence and remove the need for developers to have to hand code everything.&lt;br /&gt;&lt;br /&gt;Largely the genericized DAO is a port of an implementation I've done for several other technologies including NHibernate, Hibernate and JPA and a lot of the following annotations and enumeration types are simply there to guide the engine.&lt;br /&gt;&lt;br /&gt;Column.java:&lt;br /&gt;&lt;pre&gt;@Retention(RetentionPolicy.RUNTIME)  &lt;br /&gt;public @interface Column {&lt;br /&gt; String name() default "";&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;  * Should return a String, Long, Integer, BLOB&lt;br /&gt;  * @return&lt;br /&gt;  */&lt;br /&gt; EColumnType type() default EColumnType.String;&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;  * which direction are we going in relation to the {@link Entity}&lt;br /&gt;  * @return&lt;br /&gt;  */&lt;br /&gt; EOperation op() default EOperation.Inflate;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;EColumnType.java:&lt;br /&gt;&lt;pre&gt;public enum EColumnType {&lt;br /&gt;&lt;br /&gt; Integer(),&lt;br /&gt; Long(),&lt;br /&gt; String(),&lt;br /&gt; Blob(),&lt;br /&gt; Double(),&lt;br /&gt; Float(),&lt;br /&gt; Short();&lt;br /&gt;&lt;br /&gt; EColumnType() {  &lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;EOperation.java:&lt;br /&gt;&lt;pre&gt;public enum EOperation {&lt;br /&gt; &lt;br /&gt; Inflate(),&lt;br /&gt; Deflate();&lt;br /&gt;&lt;br /&gt; EOperation() {  &lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;IGenericDao.java:&lt;br /&gt;&lt;pre&gt;public interface IGenericDao&amp;lt;E extends IEntity&lt;integer&gt;&gt; {&lt;br /&gt;&lt;br /&gt;    public E findById(long id) throws Exception;&lt;br /&gt;&lt;br /&gt;    public void save(E entity) throws Exception;&lt;br /&gt;    &lt;br /&gt;    public void delete(E entity) throws Exception;&lt;br /&gt;    &lt;br /&gt;    public List&lt;e&gt; findAll() throws Exception; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And all of the magic really happens in the Entity and GenericDao classes.  The entity for all intensive purposes is a template that provides the ability to proxy to its concrete DAO and invoke the save method.&lt;br /&gt;&lt;br /&gt;Entity.java&lt;br /&gt;&lt;pre&gt;public abstract class Entity implements IEntity&lt;java.lang.Integer&gt; {&lt;br /&gt;&lt;br /&gt; static final String TAG = "Entity";&lt;br /&gt;&lt;br /&gt; protected Integer m_id;&lt;br /&gt;&lt;br /&gt; static Map&lt;String, Method&gt; inflationMap = null;&lt;br /&gt;&lt;br /&gt; static Map&lt;String, Method&gt; deflationMap = null;&lt;br /&gt;&lt;br /&gt; static Map&lt;Method, Column&gt; methodAnnotationMap = null;&lt;br /&gt; &lt;br /&gt; static Gson gson = new Gson();&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Default constructor for the generic. Will additionally normalize all&lt;br /&gt;  * input methods for the column names to upper case&lt;br /&gt;  */&lt;br /&gt; public Entity() {&lt;br /&gt;&lt;br /&gt;  // load all of the column annotations related to a method&lt;br /&gt;  synchronized (this.getClass()) {&lt;br /&gt;   if (inflationMap == null &amp;&amp; deflationMap == null) {&lt;br /&gt;    inflationMap = new ConcurrentHashMap&lt;String, Method&gt;();&lt;br /&gt;    deflationMap = new ConcurrentHashMap&lt;String, Method&gt;();&lt;br /&gt;    methodAnnotationMap = new ConcurrentHashMap&lt;Method, Column&gt;();&lt;br /&gt;&lt;br /&gt;    Method[] methods = this.getClass().getMethods();&lt;br /&gt;&lt;br /&gt;    for (Method m : methods) {&lt;br /&gt;     if (m.isAnnotationPresent(Column.class)) {&lt;br /&gt;      Column c = m.getAnnotation(Column.class);&lt;br /&gt;&lt;br /&gt;      if (c.op() == EOperation.Inflate) {&lt;br /&gt;       inflationMap.put(c.name().toUpperCase(), m);&lt;br /&gt;       methodAnnotationMap.put(m, c);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      if (c.op() == EOperation.Deflate) {&lt;br /&gt;       deflationMap.put(c.name().toUpperCase(), m);&lt;br /&gt;       methodAnnotationMap.put(m, c);&lt;br /&gt;      }&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public Entity(Integer id) {&lt;br /&gt;  this();&lt;br /&gt;  m_id = id;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public Integer getId() {&lt;br /&gt;  return m_id;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void setId(Integer id) {&lt;br /&gt;  m_id = id;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private java.util.Date m_lastModifiedDate;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * lastModifiedDate is exactly that. Will have column def of&lt;br /&gt;  * last_modified_date&lt;br /&gt;  */&lt;br /&gt; // @Override&lt;br /&gt; public java.util.Date getLastModifiedDate() {&lt;br /&gt;  return m_lastModifiedDate;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; // @Override&lt;br /&gt; public void setLastModifiedDate(java.util.Date date) {&lt;br /&gt;  this.m_lastModifiedDate = date;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private java.util.Date m_createDate;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * column definition create_date&lt;br /&gt;  */&lt;br /&gt; public java.util.Date getCreateDate() {&lt;br /&gt;  return m_createDate;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void setCreateDate(java.util.Date date) {&lt;br /&gt;  this.m_createDate = date;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public boolean equals(Object o) {&lt;br /&gt;  if (!this.getClass().equals(o.getClass()))&lt;br /&gt;   return false;&lt;br /&gt;  else {&lt;br /&gt;   Entity e = (Entity) o;&lt;br /&gt;&lt;br /&gt;   if (e.getId().equals(this.getId()))&lt;br /&gt;    return true;&lt;br /&gt;   else&lt;br /&gt;    return false;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public int hashCode() {&lt;br /&gt;  int result;&lt;br /&gt;  result = 29 * this.getClass().hashCode() + getId().hashCode();&lt;br /&gt;  return result;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public String toString() {&lt;br /&gt;  return String.format("[%s#%d]", this.getClass(), getId());&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void onLoad() {&lt;br /&gt;  doOnLoad();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; protected void doOnLoad() {&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void save() throws Exception {&lt;br /&gt;  Log.d(TAG, String.format("Save() called for: %s", this));&lt;br /&gt;&lt;br /&gt;  doSave();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; protected void doSave() throws Exception {&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void delete() throws Exception {&lt;br /&gt;  Log.d(TAG, String.format("Delete() called for: {0}", this));&lt;br /&gt;&lt;br /&gt;  doDelete();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; protected void doDelete() throws Exception {&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Will generate a set of ContentValues to be persisted into the database&lt;br /&gt;  * structure. This method does this by leveraging the creation of several&lt;br /&gt;  * annotation driven maps based upon {@link Column}&lt;br /&gt;  * &lt;p&gt;* This method can be overriden to not leverage the reflection driven&lt;br /&gt;  * strategy&lt;br /&gt;  */&lt;br /&gt; public ContentValues deflate() throws Exception {&lt;br /&gt;  ContentValues values = null;&lt;br /&gt;  &lt;br /&gt;  Log.d("DEFLATE", String.format("deflating %s", this.toString()));&lt;br /&gt;&lt;br /&gt;  if (deflationMap != null &amp;&amp; deflationMap.size() &gt; 0) {&lt;br /&gt;&lt;br /&gt;   values = new ContentValues();&lt;br /&gt;&lt;br /&gt;   for (String s : deflationMap.keySet()) {&lt;br /&gt;    Method m = deflationMap.get(s);&lt;br /&gt;&lt;br /&gt;    Column col = methodAnnotationMap.get(m);&lt;br /&gt;    &lt;br /&gt;    Log.d("DEFLATE", String.format("Column identified as %s, %s, %s", col.name(), col.type(), col.op()));&lt;br /&gt;&lt;br /&gt;    Object o = null;&lt;br /&gt;    switch (col.type()) {&lt;br /&gt;    case Integer:&lt;br /&gt;     o = m.invoke(this, (Object[])null);&lt;br /&gt;     Log.d("DEFLATE", String.format("Deflation value of: %s", o.toString()));&lt;br /&gt;     values.put(col.name(), (Integer)o);&lt;br /&gt;     break;&lt;br /&gt;    case String:&lt;br /&gt;     o = m.invoke(this, (Object[])null);&lt;br /&gt;     Log.d("DEFLATE", String.format("Deflation value of: %s", o.toString()));&lt;br /&gt;     values.put(col.name(), (String)o);&lt;br /&gt;     break;&lt;br /&gt;    case Short:&lt;br /&gt;     o = m.invoke(this, (Object[])null);&lt;br /&gt;     Log.d("DEFLATE", String.format("Deflation value of: %s", o.toString()));&lt;br /&gt;     values.put(col.name(), (Short)o);&lt;br /&gt;     break;&lt;br /&gt;    case Long:&lt;br /&gt;     o = m.invoke(this, (Object[])null);&lt;br /&gt;     Log.d("DEFLATE", String.format("Deflation value of: %s", o.toString()));&lt;br /&gt;     values.put(col.name(), (Long)o);&lt;br /&gt;     break;&lt;br /&gt;//    case Blob:&lt;br /&gt;//     values.put(col.name(), m.invoke(this, (Object[])null));&lt;br /&gt;//     break;&lt;br /&gt;    }       &lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return values;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Will generate a set of ContentValues to be persisted into the database&lt;br /&gt;  * structure. This method does this by leveraging the creation of several&lt;br /&gt;  * annotation driven maps based upon {@link Column}&lt;br /&gt;  * &lt;p&gt;* This method can be overriden to not leverage the reflection driven&lt;br /&gt;  * strategy&lt;br /&gt;  */&lt;br /&gt; public void inflate(android.database.Cursor c) throws Exception {&lt;br /&gt;&lt;br /&gt;  int idx = -1;&lt;br /&gt;&lt;br /&gt;  // to find a possible permutation of id&lt;br /&gt;  if ((idx = c.getColumnIndex("id")) != -1&lt;br /&gt;    || (idx = c.getColumnIndex("ID")) != -1&lt;br /&gt;    || (idx = c.getColumnIndex("Id")) != -1)&lt;br /&gt;   setId(new Integer(c.getInt(idx)));&lt;br /&gt;&lt;br /&gt;  if (inflationMap == null || inflationMap.size() == 0)&lt;br /&gt;   return;&lt;br /&gt;&lt;br /&gt;  String[] names = c.getColumnNames();&lt;br /&gt;&lt;br /&gt;  for (String s : names) {&lt;br /&gt;   Method m = null;&lt;br /&gt;&lt;br /&gt;   if ((m = inflationMap.get(s.toUpperCase())) != null) {&lt;br /&gt;    &lt;br /&gt;    int index = c.getColumnIndex(s);&lt;br /&gt;&lt;br /&gt;    setValue(m, c, index);&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Leverages the information from the {@link Column} and the&lt;br /&gt;  * {@link EColumnType} to determine which set to pass.&lt;br /&gt;  * &lt;br /&gt;  * @param m&lt;br /&gt;  *            the method we are setting&lt;br /&gt;  * @param c&lt;br /&gt;  *            The data curosr&lt;br /&gt;  * @param idx&lt;br /&gt;  *            the column index&lt;br /&gt;  * @throws Exception&lt;br /&gt;  */&lt;br /&gt; final void setValue(Method m, Cursor c, int idx) throws Exception {&lt;br /&gt;  Column col = methodAnnotationMap.get(m);&lt;br /&gt;&lt;br /&gt;  switch (col.type()) {&lt;br /&gt;  case Integer:&lt;br /&gt;   m.invoke(this, new Integer(c.getInt(idx)));&lt;br /&gt;   break;&lt;br /&gt;  case String:&lt;br /&gt;   m.invoke(this, c.getString(idx));&lt;br /&gt;   break;&lt;br /&gt;  case Short:&lt;br /&gt;   m.invoke(this, new Short(c.getShort(idx)));&lt;br /&gt;   break;&lt;br /&gt;  case Long:&lt;br /&gt;   m.invoke(this, new Long(c.getLong(idx)));&lt;br /&gt;   break;&lt;br /&gt;  case Blob:&lt;br /&gt;   m.invoke(this, c.getBlob(idx));&lt;br /&gt;   break;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;GenericDao.java&lt;br /&gt;&lt;pre&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.List;&lt;br /&gt;import java.lang.reflect.*;&lt;br /&gt;&lt;br /&gt;import android.content.ContentValues;&lt;br /&gt;import android.database.Cursor;&lt;br /&gt;import android.database.sqlite.SQLiteDatabase;&lt;br /&gt;import android.util.Log;&lt;br /&gt;&lt;br /&gt;@SuppressWarnings("unchecked")&lt;br /&gt;public abstract class GenericDao&lt;e extends Entity&gt;&lt;br /&gt;  implements IGenericDao&lt;e&gt; {&lt;br /&gt;&lt;br /&gt; protected Class&lt;e&gt; m_persistentClass;&lt;br /&gt;&lt;br /&gt; static final String TAG = "GenericDao";&lt;br /&gt;&lt;br /&gt; SQLiteDatabase db;&lt;br /&gt;&lt;br /&gt; public GenericDao(SQLiteDatabase db) {&lt;br /&gt;  this.db = db;&lt;br /&gt;  try {&lt;br /&gt;   ParameterizedType genericSuperclass = (ParameterizedType) getClass()&lt;br /&gt;     .getGenericSuperclass();&lt;br /&gt;   this.m_persistentClass = (Class&lt;e&gt;) genericSuperclass&lt;br /&gt;     .getActualTypeArguments()[0];&lt;br /&gt;&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; public SQLiteDatabase getDatabase() {&lt;br /&gt;  return this.db;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void delete(E entity) throws Exception {&lt;br /&gt;  &lt;br /&gt;  Log.d(TAG, String.format("Deleting a %s tfrom %s", entity.getClass().getName(), m_persistentClass.getSimpleName()));&lt;br /&gt;  &lt;br /&gt;  db.delete(m_persistentClass.getSimpleName(), "id = ?", new String[] { entity&lt;br /&gt;    .getId().toString() });&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public List&lt;e&gt; findAll() throws Exception {&lt;br /&gt;&lt;br /&gt;  List&lt;e&gt; retVals = null;&lt;br /&gt;&lt;br /&gt;  Cursor c = null;&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;   c = db.rawQuery("select * from " + m_persistentClass.getSimpleName(), null);&lt;br /&gt;&lt;br /&gt;   if (c.moveToFirst()) {&lt;br /&gt;    retVals = new ArrayList&lt;e&gt;();&lt;br /&gt;    do {&lt;br /&gt;     E e = newInstance();&lt;br /&gt;&lt;br /&gt;     e.inflate(c);&lt;br /&gt;&lt;br /&gt;     retVals.add(e);     &lt;br /&gt;    } while ( c.moveToNext() );&lt;br /&gt;   }&lt;br /&gt;  } finally {&lt;br /&gt;   if (c != null) {&lt;br /&gt;    c.close();&lt;br /&gt;    c = null;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return retVals;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public E findById(long id) throws Exception {&lt;br /&gt;  Cursor c = null;&lt;br /&gt;  E e = null;&lt;br /&gt;  try {&lt;br /&gt;   c = db.query(m_persistentClass.getSimpleName(), null, "id = ?",&lt;br /&gt;     new String[] { Long.toString(id) }, null, null, null);&lt;br /&gt;&lt;br /&gt;   if (c.moveToFirst()) {&lt;br /&gt;    c.moveToFirst();&lt;br /&gt;&lt;br /&gt;    e = newInstance();&lt;br /&gt;&lt;br /&gt;    e.inflate(c);&lt;br /&gt;   }&lt;br /&gt;  } finally {&lt;br /&gt;   if (c != null) {&lt;br /&gt;    c.close();&lt;br /&gt;    c = null;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return e;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void save(E entity) throws Exception {&lt;br /&gt;  if (entity.getId() == null) {&lt;br /&gt;   ContentValues cv = entity.deflate();&lt;br /&gt;   &lt;br /&gt;   Log.d(TAG, String.format("Saving a %s to %s", entity.getClass().getName(), m_persistentClass.getSimpleName()));&lt;br /&gt;&lt;br /&gt;   long id = db.insert(m_persistentClass.getSimpleName(), null, cv);&lt;br /&gt;   &lt;br /&gt;   Log.d(TAG, String.format("ID returned as %s", Integer.toString((int)id)));&lt;br /&gt;&lt;br /&gt;   entity.setId(new Integer((int)id));&lt;br /&gt;  } else {&lt;br /&gt;   Log.d(TAG, String.format("Updating %s", this.toString()));&lt;br /&gt;      &lt;br /&gt;   db.update(m_persistentClass.getSimpleName(), entity.deflate(), "id = ?", new String[]{entity.getId().toString()});&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Will take in a string query and execute it&lt;br /&gt;  * &lt;br /&gt;  * @param query&lt;br /&gt;  *            the query to execute&lt;br /&gt;  * @return a instance of E&lt;br /&gt;  * @note possibly create a permutation of this method which takes in a set&lt;br /&gt;  *       of objects and will infer the type to be added to the query&lt;br /&gt;  */&lt;br /&gt; public E queryObject(String query) throws Exception {&lt;br /&gt;  &lt;br /&gt;  return queryObject(query, (Object[])null);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Is expected to return a unique object&lt;br /&gt;  * &lt;br /&gt;  * @param query&lt;br /&gt;  * @param params&lt;br /&gt;  * @return&lt;br /&gt;  * @throws Exception&lt;br /&gt;  */&lt;br /&gt; public E queryObject(String query, Object... params) throws Exception {&lt;br /&gt;&lt;br /&gt;  E e = null;&lt;br /&gt;&lt;br /&gt;  Cursor c = null;&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;   String[] vars = null;&lt;br /&gt;&lt;br /&gt;   if (params != null) {&lt;br /&gt;    vars = new String[params.length];&lt;br /&gt;&lt;br /&gt;    for (int i = 0; i &lt; params.length; i++) {&lt;br /&gt;     vars[i] = params[i].toString();&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   c = db.rawQuery(query, vars);&lt;br /&gt;   &lt;br /&gt;   if (c.moveToFirst()) {&lt;br /&gt;    e = newInstance();&lt;br /&gt;    e.inflate(c);&lt;br /&gt;   }   &lt;br /&gt;  } finally {&lt;br /&gt;   if (c != null) {&lt;br /&gt;    c.close();&lt;br /&gt;    c = null;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return e;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Will take in a string query and execute it&lt;br /&gt;  * &lt;br /&gt;  * @param query&lt;br /&gt;  *            the query to execute&lt;br /&gt;  * @return a list of E&lt;br /&gt;  * @note possibly create a permutation of this method which takes in a set&lt;br /&gt;  *       of objects and will infer the type to be added to the query&lt;br /&gt;  */&lt;br /&gt; public List&lt;E&gt; queryObjects(String query) throws Exception {&lt;br /&gt;  return queryObjects(query, (Object[]) null);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public List&lt;e&gt; queryObjects(String query, Object... params)&lt;br /&gt;   throws Exception {&lt;br /&gt;  List&lt;e&gt; retVals = null;&lt;br /&gt;&lt;br /&gt;  Cursor c = null;&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;&lt;br /&gt;   String[] vars = null;&lt;br /&gt;&lt;br /&gt;   if (params != null) {&lt;br /&gt;    vars = new String[params.length];&lt;br /&gt;&lt;br /&gt;    for (int i = 0; i &lt; params.length; i++) {&lt;br /&gt;     vars[i] = params[i].toString();&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   c = db.rawQuery(query, vars);&lt;br /&gt;&lt;br /&gt;   if (c.moveToFirst()) {&lt;br /&gt;    retVals = new ArrayList&lt;E&gt;();&lt;br /&gt;    &lt;br /&gt;    do {&lt;br /&gt;     E e = newInstance();&lt;br /&gt;&lt;br /&gt;     e.inflate(c);&lt;br /&gt;&lt;br /&gt;     retVals.add(e);&lt;br /&gt;    } while ( c.moveToNext() );&lt;br /&gt;   }&lt;br /&gt;  } finally {&lt;br /&gt;   if (c != null) {&lt;br /&gt;    c.close();&lt;br /&gt;    c = null;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return retVals;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Due to java type erasure we capture the meta data as input on the ctor to&lt;br /&gt;  * factory later&lt;br /&gt;  * &lt;br /&gt;  * @return&lt;br /&gt;  */&lt;br /&gt; E newInstance() {&lt;br /&gt;  E instance = null;&lt;br /&gt;  try {&lt;br /&gt;   instance = (E) m_persistentClass.newInstance();&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   Log.e(TAG, e.getMessage(), e);&lt;br /&gt;  }&lt;br /&gt;  return instance;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;An example would be simple.&lt;br /&gt;&lt;br /&gt;DaoManager.java:&lt;br /&gt;&lt;pre&gt;public class DaoManager {&lt;br /&gt;&lt;br /&gt; Context context;&lt;br /&gt;&lt;br /&gt; MySQLiteOpenHelper helper;&lt;br /&gt;&lt;br /&gt; SomeEntityDao someEntityDao = null;&lt;br /&gt;&lt;br /&gt; private static DaoManager instance;&lt;br /&gt;&lt;br /&gt; private DaoManager(Context context) {&lt;br /&gt;  this.context = context;&lt;br /&gt;&lt;br /&gt;  helper = new MySQLiteOpenHelper(context);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static void initialize(Context context) {&lt;br /&gt;  if (instance == null)&lt;br /&gt;   instance = new DaoManager(context);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static DaoManager getInstance() {&lt;br /&gt;  return instance;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public synchronized SomeEntityDao getSomeEntityDao() {&lt;br /&gt;  if (watchListDao == null)&lt;br /&gt;   someEntityDao = new SomeEntityDao(helper.getWritableDatabase());&lt;br /&gt;&lt;br /&gt;  return watchListDao;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public class MySQLiteOpenHelper extends SQLiteOpenHelper {&lt;br /&gt;&lt;br /&gt;  public MySQLiteOpenHelper(Context c) {&lt;br /&gt;   super(c, "TEST", null, 2);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  @Override&lt;br /&gt;  public void onCreate(SQLiteDatabase db) {&lt;br /&gt;   Log.d("DB", "onCreate");&lt;br /&gt;   String table = "Your ddl";&lt;br /&gt;&lt;br /&gt;   db.execSQL(table);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  @Override&lt;br /&gt;  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {&lt;br /&gt;   Log.d("DB", "onUpgrade");&lt;br /&gt;   db.execSQL("drop table watchlist;");&lt;br /&gt;&lt;br /&gt;   String table = "Your ddl";&lt;br /&gt;&lt;br /&gt;   db.execSQL(table);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;SomeEntity.java:&lt;br /&gt;&lt;pre&gt;public class SomeEntity extends Entity {&lt;br /&gt; &lt;br /&gt; public SomeEntity() {&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public SomeEntity(String value, int i) {&lt;br /&gt;  this.value = value;&lt;br /&gt;  this.i = i;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; protected void doSave() throws Exception {&lt;br /&gt;  DaoManager.getInstance().getSomeEntityDao().save(this);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; @Override&lt;br /&gt; protected void doDelete() throws Exception {&lt;br /&gt;  DaoManager.getInstance().getSomeEntityDao().delete(this);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; String value;&lt;br /&gt; &lt;br /&gt; @Column(name="value", type=EColumnType.String, op=EOperation.Deflate)&lt;br /&gt; public String getValue() {&lt;br /&gt;  return value;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Column(name="value", type=EColumnType.String, op=EOperation.Inflate)&lt;br /&gt; public void setValue(String value) {&lt;br /&gt;  this.value = value;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; Integer i;&lt;br /&gt; @Column(name="intValue", type=EColumnType.Integer, op=EOperation.Deflate)&lt;br /&gt; public Integer getIntValue() {&lt;br /&gt;  return i;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; @Column(name="intValue", type=EColumnType.Integer, op=EOperation.Inflate)&lt;br /&gt; public void setIntValue(Integer value) {&lt;br /&gt;  this.i = value;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;SomeEntityDao.java:&lt;br /&gt;&lt;pre&gt;public class SomeEntityDao extends GenericDao&lt;someentity&gt; {&lt;br /&gt;&lt;br /&gt; public SomeEntityDao(SQLiteDatabase db) {&lt;br /&gt;  super(db);&lt;br /&gt;  // TODO Auto-generated constructor stub&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The major advantage to this strategy is that it allows you to put your genericized persistence logic in a lower level shared library and develop a data access layer that is much more clean and extensible.  Of course, with mobile (and or anything Android) not being as powerful as a server you'll want a lightweight implementation which is why the developer can additionally override the default implementation of Entity#deflate or Entity#inflate to make it less dynamic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-1460338494150242045?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/1460338494150242045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=1460338494150242045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1460338494150242045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1460338494150242045'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2011/04/android-persistence-framework.html' title='Android persistence framework'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-2011914926342070996</id><published>2010-04-21T07:50:00.000-07:00</published><updated>2010-04-21T08:04:51.500-07:00</updated><title type='text'>java vs .net exception model</title><content type='html'>Lately I’ve been going back and forth between java and .NET and trying to keep as many of the architectural constructs the same because of the similarities in IL representation and concepts .... plus it’s just great to have analogous ported concerns to work with.&lt;br /&gt;&lt;br /&gt;One issue I have not been able to get past is the throwable model between the two.&lt;br /&gt;&lt;br /&gt;Java:&lt;br /&gt;&amp;lt;code&amp;gt;&lt;br /&gt;public class RandomClass&lt;br /&gt;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;public void doSomething throws Exception &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;// do something&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&lt;br /&gt;}&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;br /&gt;&lt;br /&gt;.NET/C#&lt;br /&gt;&amp;lt;code&amp;gt;&lt;br /&gt;public class RandomClass&lt;br /&gt;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;public void DoSomething&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;// do something&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;// note the lack of a need to define the exception stack&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&lt;br /&gt;}&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;br /&gt;&lt;br /&gt;This poses issues for various architectures and/or frameworks when developed in one ported to another.  It’s not a huge issue b/c you can always introduce an ExceptionHandler into java as a setter on the object.  But that’s not the point of this blog.  The point of this blog is the seeming &lt;em&gt;why&lt;/em&gt; this is the case.&lt;br /&gt;&lt;br /&gt;Java’s runtime is developed in C which is a language that does not have a throwable architecture for runtime exceptions; hence, why in the JNI interface the exception isn’t thrown it’s more set and evaluated at the end of the execution of the method when returning to the Java runtime.&lt;br /&gt;&lt;br /&gt;&amp;lt;code&amp;gt;&lt;br /&gt;JNIEXPORT jvoid JNICALL example_throw(JNIEnv *env, jobject obj) &lt;br /&gt;{&lt;br /&gt;        jclass Exception = env-&amp;gt;FindClass("java/lang/Exception");&lt;br /&gt;        env-&amp;gt;ThrowNew(Exception,”some random exception);&lt;br /&gt;}&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;br /&gt;&lt;br /&gt;It’s after the end of the execution of the throw method that the exception is actually detected.&lt;br /&gt;&lt;br /&gt;Conversely the .NET runtime is implemented in C++ ... which has an inherent throwable architecture.  This makes sense why there doesn’t have to be metadata around what the exception hierarchy is that is being thrown.&lt;br /&gt;&lt;br /&gt;...... &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-2011914926342070996?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/2011914926342070996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=2011914926342070996' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/2011914926342070996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/2011914926342070996'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2010/04/java-vs-net-exception-model.html' title='java vs .net exception model'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-6498739763800661952</id><published>2010-04-02T07:46:00.000-07:00</published><updated>2010-04-02T08:31:09.806-07:00</updated><title type='text'>Java annotations and Lucene</title><content type='html'>I’m about to start a project where I hope to write a loosely coupled, extensible framework for full indexing ... specifically for searching content.  However, in doing so, I don’t want my work to need to be repeated.  Ideally the engine that is responsible for building the index should be a factory driven system that wraps the implementation.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;TextWriter writer = IndexFactory.getTextWriter();&lt;br /&gt;&lt;br /&gt;writer.write(obj);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The &lt;code&gt;getTextWriter()&lt;/code&gt; method would return a factoried, default instance of a Lucene TextWriter.  The reason to do this is it allows you to completely decouple the concern.  Now our API is based upon he API of the concern, not the implementation of the concern.&lt;br /&gt;&lt;br /&gt;This can be loosely coupled even more by create a var args block at the end of the API methods.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package com.me.indexing;&lt;br /&gt;&lt;br /&gt;public abstract class TextWriter&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public void write(IIndexable _indexable, Object... _data)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ( Validate(_indexable, _data) )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return DoWrite(_indexable, _data);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public abstract boolean Validate(final IIndexable _indexable, Object... _data);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private abstract void DoWrite(final IIndexable _indexable, Object... _data);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;which is subclassed as&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package com.me.indexing.lucene;&lt;br /&gt;&lt;br /&gt;public class LuceneTextWriter extends com.me.indexing.TextWriter &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public boolean Validate(final IIndexable _indexable, Object... _data)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// validate that the _data block contains all data needed for the particular engine&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public void DoWrite(final IIndexable _indexable, Object... _data)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// write to the particular implementaiton&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This provides the ability to create a loosely coupled interface that all applications can implement against and removes the worry that the interface couple could change over time but provides the flexibility to change the engine on the backend.&lt;br /&gt;&lt;br /&gt;We can take this one step further and introduce Java annotations into the objects that are being indexed to allow for metadata to be built into the object and consequently pushed into the index.  This allows the contract to be solidified in the design phase, the metadata to be plugged into the object and to have an abstract implementation that is data driven and not product focused.   Sound good?  I think so.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package com.me.indexing;&lt;br /&gt;&lt;br /&gt;import java.lang.annotations.*;&lt;br /&gt;&lt;br /&gt;public @interface IndexData&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string field();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public boolean tokenized();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public boolean additive();&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Allowing for such information in the class that is passed to the writer as:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package com.me.someproductneedingindexing;&lt;br /&gt;&lt;br /&gt;import com.me.indexing.*;&lt;br /&gt;&lt;br /&gt;public class SomeClass implements IIndexable // this could additional be a class level annotation&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public SomeClass(String _someDescription)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_description = _someDescription;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Typical header&lt;br /&gt;*/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@IndexData(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;field = “DESC”,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tokenized = false,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;additived = true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string getDescription()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return m_description;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Granted this entire post is barely a skeleton but it’s also 9.30 in the morning.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-6498739763800661952?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/6498739763800661952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=6498739763800661952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/6498739763800661952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/6498739763800661952'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2010/04/java-annotations-and-lucene.html' title='Java annotations and Lucene'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-4933118488164244204</id><published>2010-03-31T08:27:00.000-07:00</published><updated>2010-03-31T10:42:25.233-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='collaboration'/><category scheme='http://www.blogger.com/atom/ns#' term='cnbc'/><title type='text'>CNBC and remote collaboration</title><content type='html'>As of yesterday I accepted a position with CNBC as the head of platform development. My ultimate personal goal in the team is to increase the stability and efficiency of the development through standardized process and practice (continuous integration, release cycles, change management, domain driven development).&lt;br /&gt;&lt;br /&gt;CNBC is a Java shop currently focused mostly on web services exposed via Tomcat. I’m personally more a fan of moving towards app servers (JBoss or Glassfish) exposing EJB Stateless Session Beans internally and web services externally .... possibly backed by a lightweight, fast localized db (berkeley).&lt;br /&gt;&lt;br /&gt;This will be a great opportunity to get back into the Java realm considering I’ve been in the .NET and C++ realm for as long as I have. I will be looking forward to keeping my .NET skills honed via my own projects and collaboration initiatives (Solace SCM -- really need to get that done and it looks like I’ll have some time here soon while in NYC).&lt;br /&gt;&lt;br /&gt;One of the things that I really need to identify is a remote collaboration solution, a good wiki solution, a good team collaboration solution -- all preferably open source. After speaking to a friend about sharing remote white boards he mentioned they tried something at cisco with 2 camera, 2 projectors, 2 whiteboards and polarization filters. Brilliant. But I’m going to need a drawing solution that I can do UML on, share over webex and save to JPEG (hopefully works over USB). &lt;br /&gt;&lt;br /&gt;If anyone has any ideas or suggestions going into this position I am all ears.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-4933118488164244204?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/4933118488164244204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=4933118488164244204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/4933118488164244204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/4933118488164244204'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2010/03/cnbc-and-remote-collaboration.html' title='CNBC and remote collaboration'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-1765928517161956413</id><published>2009-06-04T20:52:00.000-07:00</published><updated>2009-06-04T20:58:06.491-07:00</updated><title type='text'>IoC</title><content type='html'>I've recently developed an IoC engine based around the concepts of "actions", "handlers" and "managers" which key off of whatever the "KeyGenerator" is defined to be... any object.  It's proving to be a highly scalable and distributable platform for a new runtime engine I'm dubbing "ActionEngine."  Coupled with the ApplicationFW that has already been developed it's going to prove to be a, nearly, 100% uptime system.  Imagine the ability to signal an application listen via a background thread to reload certain aspects of itself.  This currently exists in most app containers (Java) but not in the .NET realm (well, somewhat) ... especially not geared towards typically business problem (e.g. monitoring, p2p, etc). &lt;br /&gt;&lt;br /&gt;If I can actually get this done in a relatively short timespan it will most likely be deployed as the platform for our business. &lt;br /&gt;&lt;br /&gt;If you can imagine it you can do it.  The problem is it's many times difficult to explain the imagination.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-1765928517161956413?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/1765928517161956413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=1765928517161956413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1765928517161956413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1765928517161956413'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2009/06/ioc.html' title='IoC'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-2064295255771162198</id><published>2009-02-23T15:00:00.000-08:00</published><updated>2009-02-23T15:02:49.956-08:00</updated><title type='text'>impact</title><content type='html'>Today my company laid people off.  That sucks, simply put.  I find myself completely irrevocably relieved it was not myself dismissed.  Unfortunately some very close friends were.  I find myself heavy and low dealing with the fact that I know what goes on in their lives outside of work.  Life at times is never easy but that's why we have relationships (lovers, friends, parents) ... to help "support" us.   I take solace in the fact that I can lean on these people and their words are like liquid jade, beautiful to my ear.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-2064295255771162198?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/2064295255771162198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=2064295255771162198' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/2064295255771162198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/2064295255771162198'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2009/02/impact.html' title='impact'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-1498447970288625631</id><published>2008-12-02T15:51:00.001-08:00</published><updated>2008-12-02T15:58:57.344-08:00</updated><title type='text'>it's about that time</title><content type='html'>It's been quite some time since I've written about the strengths of humanity.  No matter how we all can become collectively selfish there always seems to be that spark that fires in each of us (mostly) that causes us to reach out to someone in their time of need.  Whether it be someone having dropped something on the side of the street on a rather serious accident.   There is that spark of humanity that unites all of us.&lt;br /&gt;&lt;br /&gt;That very same humanity is what qualifies the need for the moment that we share.  That grows the bond between us.  Whether that bond be friendship or a relationship the one major key there is to foster that bond through communication.  Communication being the most abstract concept of them all.  We "speak" in so many fashions on a daily basis that we don't even realize.  A grimmace of the brow, a smile, a passing touch and the all but most powerful, honesty!  Yes folks.  Believer it or not, but honestly is the one thing that is truly required to foster and grow the human moment.   We're all deficient in some ways -- I know I am on many occassions. &lt;br /&gt;&lt;br /&gt;One thing I've considering doing as of recent is walking up to a perfect stranger, engaging them in conversation,  and telling them exactly what I think and seeing where that conversation goes.  More often than not we're all hindered by what society qualifies as a "social norm."  Let's all throw that convention out the window and share the smile of honesty with each other.  Just look at where that's gotten everyone.  I'm sure the next person you talk to would find it refreshing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-1498447970288625631?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/1498447970288625631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=1498447970288625631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1498447970288625631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/1498447970288625631'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2008/12/its-about-that-time.html' title='it&apos;s about that time'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-8817249735204451667</id><published>2008-11-30T20:06:00.000-08:00</published><updated>2008-11-30T20:15:09.991-08:00</updated><title type='text'>Linked</title><content type='html'>I’ve been reading Laszlo’s “Linked” for some time but my in progress trip back to Denver has afforded the opportunity to finish his work.  An absolutely stellar job done I must say.  It’s opened my eyes to seeing things from a new perspective.  Primarily the statistical possibility of certain networks unfolding the way they have/do which he refers to as “preferential growth.“  This concept primarily applies to in essence ”popularity“ or ”right place at the right time.“   &lt;br /&gt;&lt;br /&gt;A thought that I’d like to dig further into in relation to this is the effects of tangential networks and how they affect each other.  In essence the effects of multiple variables in relation to an entity on multiple concepts (e.g. Apple).  Apple has historically not had a solid market share of the compfuter space until really the past four years.  It was until then that the network of links based upon market share of computer companies began to become skewed by pop culture.  Apple was able to establish an image that ultimately grew into a sub culture throttling them into a higher market share and more innovation in the product space.   The iPod was that fuel that has driven a brand and a generation.  So the question becomes ”can it be quantified how the affect of the network of subcultures -- in this case Apple -- affect market share of computer hardware?“  I think so.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-8817249735204451667?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/8817249735204451667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=8817249735204451667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/8817249735204451667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/8817249735204451667'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2008/11/linked.html' title='Linked'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-7086021155449239808</id><published>2008-11-29T13:12:00.000-08:00</published><updated>2008-11-29T13:20:21.138-08:00</updated><title type='text'>An XML driven configuration framework for Java</title><content type='html'>I’m currently looking at some of the inadequacies that exist inside of the Java architecture vs. that of .NET.  Microsoft definitely learned a good bit from watching other technologies grow -- what makes them successful and what hinders them.  One of the things that MS did very well was their concept of &amp;lt;i&amp;gt;configuration&amp;lt;/i&amp;gt;.   &lt;br /&gt;&lt;br /&gt;Microsoft’s configuration gives the framework the ability to define configuration sections where a section has a handler.  This handler is responsible for not only converting the xml into an object (similar to JAXB) but also to give an extension point for the developer to define how the object is registered with the system.&lt;br /&gt;&lt;br /&gt;My company uses this heavily for all sorts of configuration logic.  We use it for database configuration (e.g. connection strings and properties of the connection), caching, threading.  Ultimately this feeds very nicely into an IoC framework that has been development specifically for our business needs.  This is above and beyond the point from this point.   I’d like to replicate this pattern (including the core technologies that we’ve developed) into a standardized java library that a) solidifies the patterns b) their usage c) establish concrete practice in relation to abstracts and their derived grammar.  Sound like a good idea?  I think so.  The library is already developed in .NET and is HEAVILY used in our systems.   It was one of the more valuable things I’ve added to the organization.  Now if I can only figure out a solid pattern to get this done in Java.  &lt;br /&gt;&lt;br /&gt;Limitations: the .NET framework handles the reflection and invocation for you (b/c it’s intrinsic to the framework) but java does not.  This means all of the reflection assets that sit in the library will be heavily used by the library to accomplish the same goal.  From a design perspective this will mean that I’ll have to focus more heavily on that minute details.&lt;br /&gt;&lt;br /&gt;If anyone has any suggestions please let me know.  This will probably be a really good open library....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-7086021155449239808?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/7086021155449239808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=7086021155449239808' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/7086021155449239808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/7086021155449239808'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2008/11/xml-driven-configuration-framework-for.html' title='An XML driven configuration framework for Java'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-4695459449106269597</id><published>2008-11-29T09:02:00.000-08:00</published><updated>2008-11-29T09:10:28.494-08:00</updated><title type='text'>MacJournal</title><content type='html'>I’ve recently been looking for a blogging solution in the Mac world; something better than text edit.   I enjoy the tangible of writing but sometimes it is just so much easier to type and express than it is to write.... definitely far more legible.&lt;br /&gt;&lt;br /&gt;I’ve found a solution, MacJournal.  MacJournal has a lot of great attributes to it.  The ability to export if you want to print and archive -- there is nothing like going back and reading your thoughts on paper.  The ability to publish to a blogging web solution -- very sweet.&lt;br /&gt;&lt;br /&gt;This is my first test .... fingers crossed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-4695459449106269597?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/4695459449106269597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=4695459449106269597' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/4695459449106269597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/4695459449106269597'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2008/11/macjournal.html' title='MacJournal'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-6082519351083968300</id><published>2008-01-14T07:54:00.001-08:00</published><updated>2008-03-20T14:40:49.848-07:00</updated><title type='text'>saml, inadequacies in communication between tech groups, and ineffective trouble shooting.</title><content type='html'>Recently one of my developers was involved in an integration with a large service provider where a new[ish] specification/technology was used for the security layer.  In this integration (SOAP w/ SAML) the service provider (while having chosen to use the technology) had a fundamental lack of understanding as to how the technology worked (as did I at the time).  This was largely to do with the face that the application server chosen was wrapping this functionality and hiding its implementation which did not lend well towards debugging the integration.  After five days of my developer chasing his tail trying to figure out a solution due to a limitation (or perceived limitation) in .NET based upon a series of supposed "facts" I was introduced into the mix where I initiated a restatement of FACTS (yes, as in actually facts not assumptions) in which case a solution was quickly identified and it became glaringly apparent that not everyone understood how the technology was used on their end or how the specification enforced their security model (going back to the application server) -- and this is fine.  A lot of people have done this and I'm guilty of it as well.  This does go back to proper trouble shooting.  When faced with a problem always be able to verbalize your known facts in relation to your assumptions and your plain old I-don't-know's.  This will give you the ability to identify the correlations between each set and apply an order of precedence to being trouble shooting.  Will definitely speed up the process and prevent people from shooting in the dark.&lt;br /&gt;&lt;br /&gt;So, if you're ever needing to do an integration of SAML into a WSDL generated SOAP proxy call in .NET then listen up.  You can do this integration by deriving from the SoapExtension class and then defining an attribute to be placed on the SOAP proxy call ......&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;   public class MySoapExtension : SoapExtension&lt;br /&gt;   {&lt;br /&gt;       public bool outgoing = true;&lt;br /&gt;       public bool incoming = false;&lt;br /&gt;       private Stream outputStream;&lt;br /&gt;       public Stream oldStream;&lt;br /&gt;       public Stream newStream;&lt;br /&gt;                   &lt;br /&gt;       public override Stream ChainStream(Stream stream)&lt;br /&gt;       {&lt;br /&gt;           this.outputStream = stream;&lt;br /&gt;           oldStream = stream;&lt;br /&gt;           newStream = new MemoryStream();&lt;br /&gt;           return newStream;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       public string getXMLFromCache()&lt;br /&gt;       {&lt;br /&gt;           newStream.Position = 0; // start at the beginning!&lt;br /&gt;&lt;br /&gt;           string soapString = ExtractFromStream(newStream);&lt;br /&gt;         &lt;br /&gt;           return soapString;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       private String ExtractFromStream(Stream target)&lt;br /&gt;       {&lt;br /&gt;           if (target != null)&lt;br /&gt;               return (new StreamReader(target)).ReadToEnd();&lt;br /&gt;           return "";&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute)&lt;br /&gt;       {&lt;br /&gt;           return null;&lt;br /&gt;       }&lt;br /&gt;       public override object GetInitializer(Type serviceType)&lt;br /&gt;       {&lt;br /&gt;           return null;&lt;br /&gt;       }&lt;br /&gt;       public override void Initialize(object initializer)&lt;br /&gt;       {&lt;br /&gt;           return;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       public override void ProcessMessage(SoapMessage message)&lt;br /&gt;       {&lt;br /&gt;           // if we want to add a header we can hijack the output stream&lt;br /&gt;           // and load the xml into a document and manipulate it as is  &lt;br /&gt;           // here we want the AfterSerialize stage&lt;br /&gt;     &lt;br /&gt;           switch (message.Stage)&lt;br /&gt;           {&lt;br /&gt;               case SoapMessageStage.BeforeSerialize:&lt;br /&gt;                   break;&lt;br /&gt;               case SoapMessageStage.AfterSerialize:&lt;br /&gt;               {&lt;br /&gt;                   // assumed saml operations class&lt;br /&gt;                   SAMLAssertion assertion = new SAMLAssertion();&lt;br /&gt;&lt;br /&gt;                   // create assertion&lt;br /&gt;                   assertion.CreateAssertion();&lt;br /&gt;&lt;br /&gt;                   // generate signature&lt;br /&gt;                   assertion.GenerateAssertionSignature();&lt;br /&gt;                &lt;br /&gt;                   Soap11 soap = new Soap11();&lt;br /&gt;&lt;br /&gt;                   String soapBodyString = getXMLFromCache();&lt;br /&gt;&lt;br /&gt;                   XmlDocument doc = new XmlDocument();&lt;br /&gt;                 &lt;br /&gt;                   doc.LoadXml(soapBodyString);&lt;br /&gt;&lt;br /&gt;                   XmlElement soapHeaderElement = soap.CreateHeaderElement(doc);                  &lt;br /&gt;&lt;br /&gt;                   XmlElement wsseSecurityElement = doc.CreateElement("wsse", "Security", "http://schemas.xmlsoap.org/ws/2003/06/secext");&lt;br /&gt;&lt;br /&gt;                   wsseSecurityElement.AppendChild(doc.ImportNode(assertion.Xml,true));&lt;br /&gt;&lt;br /&gt;                   soapHeaderElement.AppendChild(wsseSecurityElement);&lt;br /&gt;&lt;br /&gt;                   doc.DocumentElement.PrependChild(soapHeaderElement);&lt;br /&gt;&lt;br /&gt;                   Stream appOutputStream = new MemoryStream();&lt;br /&gt;                 &lt;br /&gt;                   StreamWriter soapMessageWriter = new StreamWriter(appOutputStream);&lt;br /&gt;&lt;br /&gt;                   soapMessageWriter.Write(doc.InnerXml);&lt;br /&gt;&lt;br /&gt;                   soapMessageWriter.Flush();&lt;br /&gt;&lt;br /&gt;                   appOutputStream.Flush();&lt;br /&gt;&lt;br /&gt;                   appOutputStream.Position = 0;&lt;br /&gt;&lt;br /&gt;                   StreamReader reader = new StreamReader(appOutputStream);&lt;br /&gt;&lt;br /&gt;                   StreamWriter writer = new StreamWriter(this.outputStream);&lt;br /&gt;&lt;br /&gt;                   writer.Write(reader.ReadToEnd());&lt;br /&gt;&lt;br /&gt;                   writer.Flush();&lt;br /&gt;&lt;br /&gt;                   appOutputStream.Close();&lt;br /&gt;&lt;br /&gt;                   this.outgoing = false;&lt;br /&gt;                   this.incoming = true;&lt;br /&gt;                 &lt;br /&gt;                   break;&lt;br /&gt;               }&lt;br /&gt;               case SoapMessageStage.BeforeDeserialize:                                 &lt;br /&gt;                   break;             &lt;br /&gt;               case SoapMessageStage.AfterDeserialize:&lt;br /&gt;                   break;&lt;br /&gt;               default:&lt;br /&gt;                   throw new Exception("invalid stage!");&lt;br /&gt;           }          &lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   [AttributeUsage(AttributeTargets.Method)]&lt;br /&gt;   public class MySoapExtensionAttribute :&lt;br /&gt;     SoapExtensionAttribute&lt;br /&gt;   {&lt;br /&gt;       private int priority;&lt;br /&gt;       public override Type ExtensionType&lt;br /&gt;       {&lt;br /&gt;           get&lt;br /&gt;           {&lt;br /&gt;               // return type of extension to load&lt;br /&gt;               return typeof(MySoapExtension);&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       public override int Priority&lt;br /&gt;       {&lt;br /&gt;           get { return priority; }&lt;br /&gt;           set { priority = value; }&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;   // And finally the wsdl generated proxy call&lt;br /&gt;   [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.somecompany.com/SomeAPI/SomeMethod",&lt;br /&gt;       Use=System.Web.Services.Description.SoapBindingUse.Literal,&lt;br /&gt;       ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]&lt;br /&gt;      [return: System.Xml.Serialization.XmlElementAttribute("SomeMethod_Response",&lt;br /&gt;       Namespace="http://www.somecomapny.com/SomeAPI")]&lt;br /&gt;      [MySoapExtensionAttribute]&lt;br /&gt;   public SomeMethod_Response SomeMethod([System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.somecompany.com/SomeAPI")] SomeMethod_Request SomeMethod_Request) {                                                  &lt;br /&gt;       object[] results = this.Invoke("SomeMethod", new object[] {&lt;br /&gt;           SomeMethod_Request});&lt;br /&gt;       return ((SomeMethod_Response)(results[0]));&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;So, if anyone finds themselves faced with a similar issue in .NET realize that you can hijack the output stream, process the xml as you see fit (and even validate yet again against another xsd) and retransmit the request over the wire... Just remember, what comes back has to be able to be proxied into the response object so Soap:Header information may be lost if not exposed appropriately on the server side to be consumed by the client.&lt;br /&gt;&lt;br /&gt;Cheers.&lt;br /&gt;&lt;br /&gt;dan&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-6082519351083968300?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/6082519351083968300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=6082519351083968300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/6082519351083968300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/6082519351083968300'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2008/01/saml-inadequacies-in-communication.html' title='saml, inadequacies in communication between tech groups, and ineffective trouble shooting.'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-7747333114902731562</id><published>2007-09-16T21:12:00.000-07:00</published><updated>2007-09-16T21:14:36.790-07:00</updated><title type='text'>css difficulties</title><content type='html'>All I have to say is the entire idea of developing elastic layouts is such a pain in the butt.  I've been working on one for struts for the past week and am getting absolutely no where.  In addition the person that is doing the html doesn't understand the technologies that are backing the page so it's making things all the more difficult.  Done, going to bed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-7747333114902731562?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/7747333114902731562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=7747333114902731562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/7747333114902731562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/7747333114902731562'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2007/09/css-difficulties.html' title='css difficulties'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-2921631681776860967</id><published>2007-07-24T07:35:00.000-07:00</published><updated>2007-07-24T07:41:02.426-07:00</updated><title type='text'>the worst is there to comfort you</title><content type='html'>I've recently gone through a relatively difficult breakup and I've found myself beginning to evaluate the direction of my life.  Am I happy in my career?  Am I happy where I am?  Well, No.  I was in Pittsburgh this past weekend for a friend's wedding and met some very interesting people that have enlightened a part of me that has been ever growing, the socially aware side of me.  Class disparity, that sort of thing.  I'm currently working on an initiative to start fund raising here in Denver around an idea that I brought back from PA.  In fact, now I'm considering law school to go into public policy with a concentration on technology.&lt;br /&gt;&lt;br /&gt;At any rate, that is not what this blog is necessarily about.  This blog is about the fact that the worst is here to comfort us.  We hit a certain point and we begin to ask "Why?".  I asked why and did not come up with an answer but I did come up with a list of short  comings in myself -- or rather short comings that had developed that are not "me."  I would not have asked these questions or even begun writing again if I had not begun to look my life from a different perspective, I stood upon a chair if you will.  So, the point is... when you hit a point where you feel stuck stop looking at your feet b/c you will never see the opportunity around you.  Change your perspective... it's only a decision.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-2921631681776860967?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/2921631681776860967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=2921631681776860967' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/2921631681776860967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/2921631681776860967'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2007/07/worst-is-there-to-comfort-you.html' title='the worst is there to comfort you'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-3250017286604921252</id><published>2007-07-13T08:19:00.000-07:00</published><updated>2007-07-13T08:25:22.626-07:00</updated><title type='text'>computer "science"</title><content type='html'>I'm the architect of a mobile software company in Denver, CO.  I've quite a few years in industry, nearly 10, writing everything from low level drivers, full blown enterprise software on Solaris in C++, IL based real time distributed software for health care claims processing backed by AI engines in Lisp, to shell scripts.  I'm finding myself very frustrated these days when I meet new developers coming out of school.  The education system seems to be focusing more on industry trend and less on design and understanding.  It's about time we get back to fundamentals... b/c let's face it, there is nothing new under the sun save the virtual mapping of omega network resources across multiple machines in a virtual cluster (which has been going on for over a decade) and larger accessible memory.  Everything comes down to a lowest common denominator and when students don't know how to work with that lowest common denominator things fails.  I'm finding tons of people have no clue how IL works, why it works the way it does, why the way it works offers other intrinsic benefits to development (a single level of indirection has cured all of the problems in computer science -- this of course was in reference to the pointer and the reference ).  Can we really call ourselves computer scientists if we don't understand what is occurring at the most basic of levels?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-3250017286604921252?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/3250017286604921252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=3250017286604921252' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/3250017286604921252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/3250017286604921252'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2007/07/computer-science.html' title='computer &quot;science&quot;'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3419415261135769428.post-86063024155335071</id><published>2007-07-13T08:09:00.001-07:00</published><updated>2007-07-13T08:13:18.401-07:00</updated><title type='text'>flagstaff</title><content type='html'>Last night I was on Flagstaff working some problems, or attempting to work some problems, and saw an old man that had been climbing there for more than 35 years work the same problem with one hand.  It didn't even phase him.  He must be a true boulder institution.  I have no clue who he was but it was nice talking to him.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3419415261135769428-86063024155335071?l=williamd1618.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://williamd1618.blogspot.com/feeds/86063024155335071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3419415261135769428&amp;postID=86063024155335071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/86063024155335071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3419415261135769428/posts/default/86063024155335071'/><link rel='alternate' type='text/html' href='http://williamd1618.blogspot.com/2007/07/flagstaff.html' title='flagstaff'/><author><name>williamd1618</name><uri>http://www.blogger.com/profile/00000245313168258622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/_PYOyAiENbJA/S7vie74M-jI/AAAAAAAABjs/ObtgrwE1Kvs/S220/IMG_2133_3.JPG'/></author><thr:total>0</thr:total></entry></feed>
