Archive for the ‘Design Patterns’ Category

Creating asynchronous servlets with Tomcat 7 (Servlet 3.0 API)

Posted April 13th, 2011 by
Summary

Overall, the API is pretty straightforward to use, assuming that you are familiar with asynchronous processing in the first place. However, if you are not familiar with asynchronous processing, then this business of callbacks can be quite confusing and daunting. Additionally Tomcat 7 and Servlet API 3.0 make it easier to configure servlets using annotations. There are other cool features in 3.0 that I haven’t covered in this tutorial, like loading servlets programmatically.

Click here to read this tutorial...   |  

Android Event Dispatch Thread or Main Thread – Tutorial

Posted October 12th, 2010 by
Summary

Android applications run in a native Linux process, in the underlying Linux OS. This process houses activities (screens), widgets, and services (non visual long running application parts). When working with Android apps, it is important to remember to keep long running code running in threads that are not tied to the main thread or event dispatch thread, in order to get an “application not responding” error. A common mistake that is made is long running tasks are performed in this EDT/main thread, and this leads to lots of application failures.

Click here to read this tutorial...   |  

Hybrid Parser Architectural Pattern

Posted November 25th, 2007 by
Summary

The Hybrid Parser architectural pattern applies to software systems which need to parse documents but are constrained by memory resources and processing power available. The pattern combines the processing advantages concerning execution speed and memory resources of event driven parsers with the programming comfort of a fully-fledged document object model, provided by an object tree parser.

Click here to read this tutorial...   |  

Factory Pattern

Posted March 27th, 1999 by
Summary

When using interfaces, it is important NOT to access the implementation classes (which implement these interfaces) directly.

Click here to read this tutorial...   |  

Delegation Pattern

Posted March 27th, 1999 by
Summary

The delegation pattern can be defined as follows. When you are creating a class that does everything another class does and more, then instead of subclassing the other class, you have to declare it as a data member or property of your class.

Click here to read this tutorial...   |  

Adapter Pattern

Posted March 27th, 1999 by
Summary

The adapter pattern can be described as follows. When you have to implement an interface, but you want to use another class’ (or interface’s) methods in order to implement it you are using the Adapter Pattern.

Click here to read this tutorial...   |