Daniel Watrous on Software Engineering

A Collection of Software Problems and Solutions

Posts tagged google app engine

Software Engineering

Cloud hosting: Google App Engine vs. Amazon Web Services

My talented brother, Tim Watrous, has worked in the advertising industry for nearly 15 years now. His background started on the technical side, but he quickly found his strengths in the larger scope of marrying the business to a best possible advertising solution.

He and I often talk shop and tonight we got on the topic cloud computing. I mentioned some of my experience with the two most prominent platforms available, Google App Engine (GAE) and Amazon Web Services (AWS). The following details come from an email that I drafted for him to discuss these two platforms and some of the differences between them. Note that this is more high level than my previous discussion of GAE vs. AWS.

Google App Engine (GAE)

Google App Engine (GAE) is Google’s PaaS (Platform as a Service) offering. Unlike other mainstream hosting, they dictate the platform specifics and allow you to develop for it. This means it is not possible to run much off the shelf software on this platform. It is pay for use with a free quota, meaning small projects and testing are very cost effective.

Here’s a write up and video I did about GAE a long time ago:
http://freesourcing.org/blog/host-your-website-on-googles-servers-for-free

I also have a couple of running services that live on GAE, including this one (written in python):
http://freecontentspinner.appspot.com/

Recently I have published a lot on this site about using GAE for Java development.

Amazon Web Services (AWS)

Amazon Web Services (AWS) includes a growing suite of tools and technologies. Their main ‘hosting’ mechanism is EC2 (stands for Elastic Cloud Computing). This works a lot like a virtual server and can be setup in minutes. A principle difference between this and GAE is that AWS requires more consideration when deciding how the environment should be setup. There are times when that flexibility could both help and hurt a project.

AWS imposes fewer restrictions on what software you run and how you run it which makes more modern platforms accessible. Here’s an end to end example of an application that I developed and hosted on EC2 using Java and other modern technologies:
Java, Wicket and Hibernate on Amazon EC2 in a weekend

I have used the Amazon S3 (Simple Storage Service) for years now. It’s a type of content delivery network (CDN). I host files there that would consume too many resources on my main website and potentially make my site unresponsive. Most people never even know that I’m streaming video or downloading data from S3 instead of my own site because of how I define my URLs to amazon, like this video for my membership website:
http://media.wordpressmembershipuniversity.com.s3.amazonaws.com/video/wmu-optin-video-im.mp4

Most people look at the first bit and think it’s hosted directly on wordpressmembershipuniversity.com…

Misconceptions

I think the most common misconception most business folks have when they talk about cloud computing is the idea that it’s just a more robust or salable version of the solutions they have used in the past. In some respects that might be true. But there are some more significant differences.

Think about it like this. If you think about web hosting like a car, then you would be tempted to think about typical hosting like a little four cylinder economy car and cloud computing might seem like a V10 Dodge Viper. In reality, cloud computing is more like a build it yourself kit car and may be smaller than an economy car or larger than the biggest road car.

The importing point to be clear on is that it’s often NOT a drop in replacement for your current slow running web application.

Software Engineering

Wicket + GAE automatic reload

One disappointment of developing for Wicket and Google App Engine (GAE) is that the automatic monitoring and reloading of modified HTML files didn’t work. It had something to do with the single threaded nature of the GAE platform.

I had found a few previous efforts to make this work, but none of them worked with the current version of Wicket and GAE. I went without it for a while, but restarting the web server after every markup change finally drove me to figure it out.

Working with the project that I setup using my Wicket + GAE tutorial, I added two new files and modified the WicketApplication. Here are the details.

GaeModificationWatcher.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package com.danielwatrous.softwarelicensing.web;
 
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.Map.Entry;
 
import org.apache.wicket.util.listener.IChangeListener;
import org.apache.wicket.util.time.Duration;
import org.apache.wicket.util.time.Time;
import org.apache.wicket.util.watch.IModifiable;
import org.apache.wicket.util.watch.IModificationWatcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
public class GaeModificationWatcher implements IModificationWatcher {
 
	private static final Logger LOG = (Logger) LoggerFactory
			.getLogger(GaeModificationWatcher.class);
 
	ConcurrentHashMap<IModifiable, Set<IChangeListener>> listenersMap = new ConcurrentHashMap<IModifiable, Set<IChangeListener>>();
	Duration pollFrequency;
	Time lastCheckTime;
	Object timeCheckLock = new Object();
 
	public boolean add(IModifiable modifiable, IChangeListener listener) {
		checkResources();
		HashSet<IChangeListener> listenerSet = new HashSet<IChangeListener>();
		Set<IChangeListener> listeners = listenersMap.putIfAbsent(modifiable,
				listenerSet);
		if (listeners != null) {
			return listeners.add(listener);
		} else
			return listenerSet.add(listener);
	}
 
	public IModifiable remove(IModifiable modifiable) {
		if (listenersMap.remove(modifiable) != null) {
			return modifiable;
		} else {
			return null;
		}
	}
 
	public void start(Duration pollFrequency) {
		LOG.debug("Starting watcher");
		synchronized (timeCheckLock) {
			lastCheckTime = Time.now();
			this.pollFrequency = pollFrequency;
		}
	}
 
	public void destroy() {
		// do nothing
	}
 
	public Set<IModifiable> getEntries() {
		return listenersMap.keySet();
	}
 
	public void checkResources() {
		Time now = Time.now();
 
		Time timeCheck;
		synchronized (timeCheckLock) {
			if (lastCheckTime == null) {
				return; // not started
			}
 
			Time nextTimeCheck = lastCheckTime.add(pollFrequency);
			if (nextTimeCheck.after(now)) {
				return; // nothing to do, not ready
			}
 
			// lets go
			timeCheck = this.lastCheckTime;
			this.lastCheckTime = now;
		}
 
		Set<Entry<IModifiable, Set<IChangeListener>>> entrySet = new HashSet<Entry<IModifiable, Set<IChangeListener>>>(
				listenersMap.entrySet());
 
		for (Entry<IModifiable, Set<IChangeListener>> entry : entrySet) {
			if (timeCheck.before(entry.getKey().lastModifiedTime())) {
				LOG.debug("Found modification, notifying listeners of change");
				for (IChangeListener listener : entry.getValue()) {
					listener.onChange();
				}
			}
		}
	}
}

GaeReloadRequestCycleListener.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.danielwatrous.softwarelicensing.web;
 
import org.apache.wicket.Application;
import org.apache.wicket.RuntimeConfigurationType;
import org.apache.wicket.request.cycle.AbstractRequestCycleListener;
import org.apache.wicket.request.cycle.RequestCycle;
 
public class GaeReloadRequestCycleListener extends AbstractRequestCycleListener {
 
	public void onBeginRequest(RequestCycle cycle) {
		if (Application.get().getConfigurationType().equals(RuntimeConfigurationType.DEVELOPMENT)) {
			final GaeModificationWatcher resourceWatcher = (GaeModificationWatcher) Application.get()
					.getResourceSettings().getResourceWatcher(true);
			resourceWatcher.checkResources();
		}	
	}
}

WicketApplication.java

I haven’t provided all the details for this class, but this should show you how to implement it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class WicketApplication extends WebApplication
{    	
	...
 
	/**
	 * @see org.apache.wicket.Application#init()
	 */
	@Override
	public void init()
	{
		super.init();
 
		...
 
		// add your configuration here
		getRequestCycleListeners().add(new GaeReloadRequestCycleListener());
		IModificationWatcher watcher = new GaeModificationWatcher();
		watcher.start(Duration.ONE_SECOND);
		getResourceSettings().setResourceWatcher(watcher);
	}
}

Resources

http://agilewombat.blogspot.com/2010/01/wicket-on-google-app-engine.html
http://apache-wicket.1842946.n4.nabble.com/How-can-I-reload-HTML-in-app-engine-td3005241.html
http://apache-wicket.1842946.n4.nabble.com/Reload-html-in-Wicket-GAE-td4363236.html

Software Engineering

Software licensing: Authentication and authorization for admin pages

For simplicity and security I’ve decided to integrate with the Google Account authentication mechanism that’s built into Google App Engine. This allows anyone with a Google account to login to my application without the need to setup another account. This also gives me access to the user’s valid email in order to send messages and other communication related to the service I provide.

So far I have three separate ‘areas’ for interfacing with my service. The first area is comprised of public pages, such as the home page or privacy policy. The next area is the API where RESTful access will take place. That leaves the administration area where an account administrator will be able to view statistics, adjust licenses, etc. These are mapped as follows

http://domain/
http://domain/api/
http://domain/admin/

The API will require authentication with each call in the form of an apikey (may change to oAuth in the future). I was able to secure the admin area of the site by adding a security-constraint to the web.xml file. Here’s what that looks like.

1
2
3
4
5
6
7
8
9
10
11
<web-app ...>
	...
	<security-constraint>
	   <web-resource-collection>
	       <url-pattern>/admin/*</url-pattern>
	   </web-resource-collection>
	   <auth-constraint>
	       <role-name>*</role-name>
	   </auth-constraint>
	</security-constraint>
</web-app>

You might have noticed this mechanism is not limited to authentication only. It’s also possible to include authorization preferences by role using role-name.

Software Engineering

Software licensing: The value of good books

I have a large budget for books (but thanks to Amazon it doesn’t have to be as big as it could be). Sure it’s true that most of the information in programming books is online and available for free. There may even be substance to the argument that most books are out of date as soon as they hit the shelf because technology moves so fast. Oh well.

I get huge value from books. They save me many hours of time that I might spend scouting around for a snippet here or an explanation there. One of my favorite publishers of technology books is O’Reilly.

For this project I purchased Programming Google App Engine by O’Reilly. It’s a fantastic book so far and covers a lot of ground. Bookmarking, highlighting and so on gives me a quick path back to bits that I’ve learned.

Another book I purchased for this project and for my shelf is Thinking in Java (4th Edition) by Bruce Eckel. I previously read the free downloadable version of his 3rd edition. He provides uncommon depth in his approach, tying Java back into the other languages that inspired it. That context is extremely valuable!

If you have a hard time spending $100 or more on books for a project, just ask yourself how many hours you would have to save in order to justify the cost. At today’s contractor rates that might only be two or three hours to hit the break even point. Across the life of a project, a well written and edited book from a trusted publisher can save you many more hours than that.

Software Engineering

Software licensing: Jersey framework for REST

I did some investigation into building the RESTful API for the software licensing system using wicket. At first I was encouraged that URL management was so easy (nevermind that really old article I just linked to).

Wicket Not Ideal for RESTful APIs

In the end I decided that wicket was not a good choice for the RESTful API. The crux came in treating HTTP methods differently. In other words, for a given resource URI, I want to do something different for GET, POST, PUT and DELETE. That’s not one of wicket’s strengths, so I moved on.

The first framework I looked at had a really slick look. I know that’s not necessarily an indication of technical superiority, but the simplicity of the homepage made me believe that Restlet would be a good choice. But before making my choice, I looked for references and found this stackoverflow discussion.

Jersey Wins

I had seen Jersey before reading that, but was turned off thinking I had to dive deep into glassfish and other technologies. The stackoverflow discussion convinced me to give Jersey a try and I’m so glad that I did. In about a half an hour I had my initial API calls framed and responding to web calls in Google App Engine.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.danielwatrous.softwarelicensing;
 
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
 
//The Java class will be hosted at the URI path "/sitelicenses"
@Path("/sitelicenses")
public class SiteLicenses {
 
	@GET
	@Produces("text/plain")
	public String getAllSiteLicenses() {
		// Return some cliched textual content
		return "Hello World GET";
	}
 
	@POST
	@Produces("text/plain")
	public String createNewSiteLicense() {
		return "Hello World POST";
	}
 
	// @PUT
	// @DELETE
}

I followed this extremely concise Jersey + GAE tutorial to get things going. There were more jar files required that are shown there. Otherwise I can’t believe how easy it was to get my RESTful API framed in and working.

TIP:

About a year ago I found a great tool to explore REST and test RESTful services. It’s a Chrome plugin named Simple REST Client. This makes it possible to send requests to a URI using any of the HTTP methods and see the full response, including headers. Here’s a screenshot of my first API response:

Software Engineering

WordPress plugin licensing: Wicket on Google App Engine

For the user interface layer of the licensing system I was interested in using a framework like Wicket. It was a lot of work to setup. The process was made somewhat frustrating by the fact that most of Google’s results are a few years old and deal with older versions.

I did finally get it working and here’s the process. Other articles take the default Google App Engine project and modify it to accommodate wicket. I decided to go the other direction and start with the wicket quickstart. This is the process I followed and links to the resources that I used. Hopefully that makes this post age better. We’ll see 🙂

Add Maven support to Eclipse

Since I wanted to start with the current wicket quickstart, I needed maven. Eclipse doesn’t support maven out of the box, but there’s a great plugin that makes working with Maven projects easy. You can get all the details at http://eclipse.org/m2e/.

Generate a wicket quickstart project

The wicket project provides a rather clever mechanism based on Maven to build a quickstart project based on various release version of wicket. You can access the quickstart configuration tool at http://wicket.apache.org/start/quickstart.html.

What that generates is a Maven command. As long as you have Maven installed on your computer, you should be able to generate a quickstart project based on that command. If they maintain this resource then it should be easy to create a fresh project for any future version of wicket. Here’s what I ran to create the quickstart for the licensing system:

Import into Eclipse and Configure for GAE

Now we need to import this project into eclipse and configure it to work with Google App Engine. If you have already install the Maven to Eclipse plugin above then you should be able to import the project. To do this choose File -> Import. From the import dialog choose Existing Maven Project.

On the next screen you provide the path to the directory where the pom.xml file is and choose Finish. Now you have an eclipse project for your wicket quickstart.

Add Google App Engine libraries

Add the Google App Engine libraries to your project by opening the Java Build Path dialog and choosing from available libraries (this assumes you have eclipse setup for google app engine development).

Update project settings for GAE

The process of updating the projects settings feels a bit clumsy because you have to save some settings before others will take. Begin by opening the project settings (right click on project name in Package Explorer panel of Eclipse). The first thing you need to do is set the war directory under Google -> Web Application.

Save this setting and close the properties window. Next you need to reopen the window and navigate to Google -> App Engine. There you will check the box next to “Use Google App Engine”.

This will have generated a problem, but you might not see it. Open the Problems panel in Eclipse using the menu options Window -> Show -> Problems. In the problems view you will see that there’s an error indicating that the appengine-web.xml file is missing. You need to right click on the error and choose Quick Fix. Eclipse will create the appengine-web.xml file for you.

Now would be a good time to make a small update to the appengine-web.xml to enable session support (something that’s disabled by default on the App Engine platform). This change is very straight forward and the line you need to add to the file is already in there as a comment. Here’s the line you need to add:

<sessions-enabled>true</sessions-enabled>

Copy over properties and jars

Now we need a handful of files copied over to our WEB-INF/lib directory so that the GAE development server can find them. This include the followng jar files:

  • log4j
  • slf4j-api
  • slf4j-log4j
  • wicket-core
  • wicket-util
  • wicket-request

I’ve left off the version details since those may be different when you get around to this, but you can see below how your WEB-INF/lib directory should look.

You might have noticed while editing the appengine-web.xml file above that it expects a logging.properties file in WEB-INF. You can create this file with this single line:


.level = WARNING

Update pom.xml output directory, etc.

The default output location for compiled classes is under the ‘target’ directory. The Google App Engine development environment will look under webapp, so we need to modify the Maven configuration file to indicate the directories where we want the compiled classes to go. This is done by adding a couple of elements to the build element as shown below.


<project ...>
  <build>
    <directory>src/main/webapp/WEB-INF</directory>
    <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
    ...
  </build>
</project>

Related to the above modification, we need to update the classpaths for builds. This is easily done by opening the project properties and removing the hard coded references to the output directory and making sure the default value is correct. Here’s what that looks like:

While we have the pom.xml file open, let’s make a few other small changes. One will reduce the noise of warnings we get during development. This has to do with the encodings of the files that are copied over during a build cycle.


<project ...>
  <properties>
    ...
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>

Wicketstuff gae-initializer

The final required step is to use the gae-initializer that’s part of the wicketstuff repository. You can view the repository https://github.com/wicketstuff/core.

There are two ways to incorporate this into your project. One is through the Maven configuration file. The other is by including the wicketstuff-gae-initializer-1.5.3.jar directly. In order to make my development environment work correctly I had to include the jar file. You can find the jar files here:

http://repo2.maven.org/maven2/org/wicketstuff/wicketstuff-gae-initializer/1.5.3/

To incorporate the gae-initializer into your pom.xml file, open your pom.xml file and click on the Dependencies tab. You can then Add the dependency with the following details:


<project ...>
  <dependencies>
    <dependency>
      <groupId>org.wicketstuff</groupId>
      <artifactId>wicketstuff-gae-initializer</artifactId>
      <version>YOUR-WICKET-VERSION</version>
    </dependency>
    ...
  </dependencies>
</project>

Here’s what it looks like in Eclipse:

I suppose that alone should be enough, and it might be enough for your deployment to production in Google App Engine, but I found that I also need to add the JAR to my build path as an external JAR. This is how I did that:

I now have a running wicket application in Google App Engine.

Resources

Below are a list of old (and very old) tutorials. I couldn’t get these to work with the current version of wicket and GAE. Still, they may be useful if you encounter problems related to features that I didn’t use or test.
http://www.danwalmsley.com/2009/04/08/apache-wicket-on-google-app-engine-for-java/
http://stronglytypedblog.blogspot.com/2009/04/wicket-on-google-app-engine.html
http://stronglytypedblog.blogspot.com/2009/07/wicket-spring-jdo-on-google-app-engine.html

Documentation for gae-initializer in wicketstuff core repository:
https://github.com/wicketstuff/core/wiki/Google-AppEngine-Initializer

This thread covered some points that might fill in gaps:
http://mail-archives.apache.org/mod_mbox/wicket-users/201003.mbox/%3C1269607382.11633.11.camel@kaffeeserver%3E

This article had some discussion of serialization problems. I think that the gae-initializer that I cover in this article addresses the points in the article below.
http://thoughts.inphina.com/2010/10/20/managing-wicket-serialization-problem-on-google-app-engine/

Complaints about GAE not supporting wicket properly (related to above article):
http://code.google.com/p/googleappengine/issues/detail?id=2500

My most recent thread on the wicket users list working through some of the points in this article:
http://apache-wicket.1842946.n4.nabble.com/Wicket-on-Google-App-Engine-td4259205.html

Software Engineering

WordPress plugin licensing: Setup Eclipse for Google App Engine development

Having chosen Google App Engine and Java as the target for initial development it’s time to setup a development environment. Google provides a plugin to Eclipse that makes this easy. They do a great job explaining how to setup the environment at this URL:

http://code.google.com/appengine/docs/java/tools/eclipse.html

Setup problems

One hang up I had was an error when first trying to install the plugin in eclipse. It complained about “An error occurred while collecting items to be installed”. Several files came back saying “Unable to read repository” and “Read timed out”. It was possible to download these directly (outside of Eclipse) so I downloaded the ones that produced errors and moved then into the plugins folder. After that the installation process worked as outlined in the link above.

Possibly related to the problem I just mentioned was that I had to manually extract com.google.appengine.eclipse.sdkbundle_1.6.1 into its own directoy and in preferences I had to point to the sdk manually. I did this by going to Window -> Preferences. In the preferences window navigate to Google -> App Engine. There you can Add a link to the directory where you put your sdk files from the above mentioned jar.

In case you plan to develop for GWT, you may need to set additional variables for your Java runtime environment

Using Eclipse for GAE Development

About halfway down the page for installing the Eclipse plugin (link above) there are two sections that take you through the process of creating and running a project. When I created a new project I selected the checkbox to generate sample project code. This created a Hello World project and made it a snap to test that my environment was setup correctly.

If you’ve accomplished everything above then you should be able to load http://localhost:8888 and see your test application.

One thing I love about developing for app engine in Java with this setup is that the build/deploy process happens automatically. Eclipse rebuilds classes each time the source for that class is saved. The newly compiled class is inserted into the running web server. The same is true for changes to static files and resources. This means you can simply save and refresh, much like you would when using an interpreted language. A small gotcha is that you must ‘Debug As’, NOT ‘Run As’ in order for this dynamic refresh behavior to work.

Software Engineering

WordPress plugin licensing: Google App Engine vs. Amazon EC2

In the introduction to this series, I outlined some of the requirements for the WordPress plugin licensing platform: Speed, reliability and scalability. These are critical. Just imagine what would happen if any of those were missing.

Requirements Justification

A slow platform might result in significantly fewer sales. One of our use cases is to provide a free, limited time trial, and poor performance when installing or using a plugin would almost certainly decrease sales conversions. Reliability issues would, at a minimum, reduce developer confidence when coupling a new plugin to the licensing platform. Finally, if the speed and reliability don’t scale then the market of potential consumers is limited to smaller plugins.

Possible solutions

Fortunately the problem of speed, reliability and scalability have already been solved. I know that it’s possible to build out servers, load balance them and otherwise build out systems to achieve these three aims, but I have something much simpler in mind. The two most compelling options available today both allow a developer to leverage the infrastructure of very large companies that exist solely on the internet: Amazon and Google.

The business model of both Amazon and Google require them to build out their own internal infrastructure to accommodate peak volume. The big downside to this is that the majority of the time, some or most of that infrastructure is sitting idle. A somewhat interesting upside to the scale of their infrastructure is that they have had to develop internal processes that enable them to expand supply in step with demand. In other words, they have to be able to add additional resources on the fly in the event of a new record peak. That may not sound as impressive as it is 🙂

At some point, each of these companies realized that they could leverage their unused infrastructure to increase their revenue. They more or less sub-lease existing resources to third parties. As this product model developed they may have isolated the resources they sell from the resources that power their main websites, but there is still a great deal of play between them. The two offerings are Google App Engine (GAE) and Amazon Web Services (AWS).

App Engine vs. Amazon Web Services

.

There are many more differences between these two platforms than I have time to get into here. However, one distinction between the two is helpful. Amazon offers a wide range of services (they add new services often) that provide the developer with a great deal of flexibility. However, the burden of choosing the right platform components and interconnecting them is also on the developer.

Google on the other hand has a more narrowly defined and inclusive platform. Rather than separating content distribution, processing, messaging, etc., Google keeps it all under the same hood. This reduces complexity for the developer at the cost of some flexibility.

This distinction is rather natural when you consider the diversity of products and engagement channels employed by Amazon and compare that to the more narrow range of services and engagement channels employed by Google.

The winner?

For the licensing project that I’m developing in this series, the scope is well defined and not overly complex. Google App Engine is the most appealing due to the ease of working in a local development environment and the ability to deploy and test on the live platform under the free quota limits (no initial cost or setup). It’s important to note that choosing Google’s platform instead of Amazon’s doesn’t make Amazon the loser and it doesn’t have to mean that I need to exclusively run on Google’s platform forever.

GAE provides both Python and Java enviornments. If I choose Java and approach the design carefully (e.g. good datastore abstraction…), it may not require too much effort to deploy on an Amazon EC2 instance if that becomes more appealing down the road.

Conclusion

The WordPress plugin licensing system will target the Google App Engine platform initially. Special attention will be given to abstracting the datastore so that I can take advantage of Google’s fast and scalable datastore and leave myself flexibility to move to an alternate if I deploy on Amazon’s platform in the future. Java is a first class citizen on both platforms. This provides some assurance that mainstream, mature frameworks will run smoothly. It also typically means that there will be plenty of documentation and support to accelerate development and deployment along.

Software Engineering

A Java based licensing system for premium WordPress plugins

The market for premium wordpress plugins is very active these days. Despite the disagreement over GPL specifics, there are an increasing number of extremely skilled software developers that create high quality plugins for WordPress.

One problem that they all have is a licensing mechanism that will allow them to distribute their software plugin freely, but restrict its use to those who have paid. In some cases it is desirable to provide a free limited time trail.

In this series of articles I’m going to show you how I develop a licensing system for wordpress plugins.

Always start on paper

One of the first rules I use when developing new software is to always start on paper. This does a few things for me. First is that I have to think in terms of the problem and solution, not code. Another is that I have a visual reference to keep me on track as I start to develop. Yet another is that I have a simple document to share with collaborators.

Here’s my initial sketch for the licensing system. It will get more complex, but this does a good job capturing the aims of the project. Click on the image to see it larger.

wordpress plugin licensing initial design sketch