Uncategorized

Decoding the GPL: can this be commercial?

I’ve been doing some research lately in preparation for a new project.  (Yes, another new project.) The goal of this project is ultimately to produce some software that my customers will license from me (monthly rate) and install on their own servers.

On the face of it, a simple task indeed; however, the task grows significantly more complex when I consider the ramifications of using some open source components in the development of my product.

A little back story. I do a lot of work in open source. I love open source. I have written code from scratch and open sourced it; and when I do, I license my open source with the the GNU GPL, version 2.

What the heck does that mean?

The GNU General Public License is a software license designed to protect licensee freedom. There is an important distinction to be made here, and the GNU folks do it quite nicely

The word “free” has two legitimate general meanings; it can refer either to freedom or to price. When we speak of “free software”, we’re talking about freedom, not price. (Think of “free speech”, not “free beer”.) Specifically, it means that a user is free to run the program, change the program, and redistribute the program with or without changes.

The armchair lawyer in me interprets this as follows.  Code licensed under the GPL must always be free – free to be executed, free to be modified, and free to be redistributed (though a distributor may charge money to his customers for the privilege of downloading it – this is relevant for big things like Linux distros).

So, if I acquire some GPL licensed open source software and I modify it, I am legally bound to allow those to whom I distribute the code to exercise the same rights I did under the protection of the license.

But what happens if I don’t modify the source code?

What if instead the open source component were simply that: a component of a larger system?  Surely the code I do write will be dependent on the open source in some way (or more likely, many ways). But if I am not modifying the open source programs, am I obligated to set my own code free?

Consider the specifics of my project. I’m writing a Web application that I want to distribute, to be run on my customer’s own hardware. (Running the software is actually one of the key features of the product, and offers enormous differentiation in this new age of so-called Cloud Computing.)

There will be four open source products comprising the application server stack: Tomcat, Quercus, HSQL, and CodeIgniter.  They don’t all play together out of the box, but getting them to that point is a matter of configuration not customization. So I put them all together and, voila!, I have a portable PHP Web Server with a built-in database and job scheduler.

From CodeIgniter up, the code I write will be 100% my own.  So the question becomes: if my application is dependent upon but not a derivative of my application server stack, does my application need to be released under the terms of the GPL? According to my interpretation of the GPL, the answer is no.

It is fully my intention to document and release the application server stack. It sounds a bit esoteric, I know: “a portable PHP server.” But trust me: it has its usefulness.  Don’t get me wrong, Java is a great language; but developing Web applications in Java or a Java-compiled language like Groovy is still more difficult and more tedious than it should be.  Challenges like writing an auto-updating mechanism and a plug-in framework seem down right easy in PHP, compared to what would likely be a solid month of trail and error engineering in Java.

So what do you think? Must my product be free, or will I be allowed to be the sole profiteer?

Braggin’ on my new theme

I’m not a designer.  So when I have the opportunity to brag about something I designed, I try to take advantage.

One of my goals scheduled for before the birth of my first child (three days and counting!) was to get my blog design set.  I wanted to have something that was aesthetically appealing (to my personal aesthetics, anyway), and very functional.  Something I could pour my mind into reliably, if somewhat infrequently.

So today I give you the latest version of my blog.  The design borrows heavily from a personal project I’m working on (can’t tell you any more about it just yet, but it’s for project management). I like the soft corners, and Twitter colors: it feels homey to me – I’ve always thought blue was very comforting.

I’m using a custom WordPress plug-ins for Twitter/Bit.ly and Facebook comments – the latter being something that I open-sourced not long ago, but then withdrew (because it had a major flaw, and because I wanted to mix it into a more comprehensive tool – I’ll be releasing it again soon!).  I’ll be adding some more feature soon, mostly in an effort to turn some profit from my traffic (if I ever manage to develop any).

So, what do you think?

Replace commenting in your Wordpress blog with Facebook Comments

@RealNerd showed me how.  And now you can benefit from our collaboration.

Enjoy.

From the iPhone

I can imagine that being able to blog from my iPhone might be handy at some point in the future. But of all the ways to compose content, this is by far the least effective.

Static class awareness coming to PHP 5

From time to time, I go digging through the PHP documentation on PHP.net hoping to discover that the PHP commiters have added better (read: more standardized) support for static properties.  PHP’s implementation of object-oriented programming is good, if a little incomplete and inconsistent with other good object-oriented languages (like Java, for instance – no pun intended).

PHP’s handling of static properties in one such shortcoming.  Typically, properties and methods defined statically are bound to the class definition, and are accessed using a class’ name instead of an instance of it.  For example, a static property named foo of class Bar is accessed Bar::$foo.  Similarly, a static method named world of class Hello is accessed  Hello::world();  PHP incorporates these ideas in a natural fashion.

It is in subclassing that PHP falls all over itself.

Let’s say I want to create a static property named foo on a class Bar. The class definition would look something like this

class Bar {
    static $foo = 'value';
}
copy code

Now, let’s say I want to create a subclass of Bar called BarSubclass.  Typically, if I wanted to provide a new value for the static property foo, I would simply override it in my subclass’ definition like this

class BarSubclass extends Bar {
    static $foo = 'new_value';
}
copy code

One would then expect the following results

echo Bar::$foo; // "value"
echo BarSubclass::$foo; // "new_value"
echo (Bar::$foo != BarSubclass::$foo); // "1" (for true)
copy code

Unfortunately, in PHP land, one gets the following output instead

echo Bar::$foo; // "value"
echo BarSubclass::$foo; // "value"
echo (Bar::$foo != BarSubclass::$foo); // "" (nothing - for false)
copy code

The reasoning behind this doesn’t really matter to me.  I’m sure it has something to do with PHP’s inventors interpreting the word “static” to mean not only “belonging to the class,” but also “not overridable.”

This evening I received a glimmer of hope.  On February 13 someone updated the PHP docs, and in those docs is a new method: get_called_class().  This method, callable only from within the bodies of class methods, returns the name of the class in which the function is being invoked.  The function can discern the name of the class in which it is being called, even if the method is statically defined.  This means that at long last, I can define static methods that correctly identify the class in which they are being called.

Why is this important?

A great feature for an ORM library (like scottlib) would be a static get method through which callers could load indexed instances of objects by their primary key values, e.g.

$obj = MyObject::get(42);
copy code

Until get_called_class(), this was impossible because the definition of the get method existed only at the highest level of the class hierarchy, and there, would be unaware of any subclass that might want to produce an instance of itself instead of the supreme parent.

The only drawback here is that we probably won’t be seeing this functionality in our hosting any time soon.  The feature is planned for version 5.3.0.  PHP is presently in version 5.2.8 (my Mac came with version 5.2.6).  In the meantime I’ll be adding static loaders and method calls to scottlib, each with an extra parameter for the class name.  Once PHP 5.3.0 hits production, the extra parameter will be phased out in favor of get_called_class().

Hold onto your keyboards – PHP is about to get a whole lot cooler.

Finally, a starting point

Here I am, persevering as usual.  Presently I’m trolling my way through the iPhone Reference Library, fishing for some semblance of an organized tutorial on application development.  I’m sure that if you have a background in Cocoa or Objective-C, then you’re several steps ahead of me.  Java and PHP experience aren’t lent well to this iPhone stuff.

But tonight I did finally find somewhere to start (reading, that is, as I’ve been playing with Xcode and documentation for about 40 hours now).  Keep in mind that you will need to sign up for an Apple Developer Connection (ADC) account before you can access this document.

Without further adieu, Your First iPhone Application: Application Bootstrapping.

Amazon Web Services to include content delivery service

I received the following e-mail from Amazon.com today.

Many of you have asked us to let you know ahead of time about features and services that are currently under development so that you can better plan for how that functionality might integrate with your applications. To that end, we are excited to share some early details with you about a new offering we have under development here at AWS – a content delivery service.

This new service will provide you a high performance method of distributing content to end users, giving your customers low latency and high data transfer rates when they access your objects. The initial release will help developers and businesses who need to deliver popular, publicly readable content over HTTP connections. Our goal is to create a content delivery service that:

  • Lets developers and businesses get started easily – there are no minimum fees and no commitments. You will only pay for what you actually use.
  • Is simple and easy to use – a single, simple API call is all that is needed to get started delivering your content.
  • Works seamlessly with Amazon S3 – this gives you durable storage for the original, definitive versions of your files while making the content delivery service easier to use.
  • Has a global presence – we use a global network of edge locations on three continents to deliver your content from the most appropriate location.

You’ll start by storing the original version of your objects in Amazon S3, making sure they are publicly readable. Then, you’ll make a simple API call to register your bucket with the new content delivery service. This API call will return a new domain name for you to include in your web pages or application. When clients request an object using this domain name, they will be automatically routed to the nearest edge location for high performance delivery of your content. It’s that simple.

We’re currently working with a small group of private beta customers, and expect to have this service widely available before the end of the year. If you’d like to be notified when we launch, please let us know by registering below.

Now what someone needs to do is write a component for Joomla that publishes content to AWS S3 and to this new content delivery service.  The end result would be high-availabilty content managed by the best Open Source CMS on the market.  Nice.

Update: Om Malik of GigaOm analyzes the potential of an Amazon CDN, noting that AWS S3 customer Voxel beat Amazon to the punch, and discusses the threat this represents to established CDNs Akamai and Limelight.

PHP ORM with annotations

Update An update at the top of a post?  Yeah, well, the thing is, I decided to terminate the sfEzModel project.  For one thing, I’ve started thinking Syfmony ain’t exactly the best PHP framework on the block.  Furthermore, I don’t think this particular solution deserves to be stuck inside a framework. It should be free: standalone, or dropped in a framework, whatever.  So I’ve replaced it with a different project: scottlib.

Named after my best friend, scottlib is intended to be a SQL abstraction tool that even a designer could easily incorporate into his wireframed project.  That’s a tall order to fill, but along the way I’ll be doing some cool stuff too, like emulating GORM, and making it easy to switch between MySQL and Amazon’s SimpleDB.  Hang around, it’s going to get cooler.

I recently started our first Google Code project – sfEzModel: a PHP ORM library with annotation configuration, optimized for MySQL and designed for easy integration into Symfony Web applications.

“What?” you ask? ORM stands for Object-Relational Mapping and “is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages” (Wikipedia).  Basically, ORM is an attempt to make-easier the process of persisting (storing) object data – data that has an explicit form or type yet doesn’t readily lend itself to the scalar data types of an RDBMS like MySQL (or SQLite or SQL Server).  If you’re still in the dark, check out the Wikipedia article.

“Why?” you ask? Well, first and foremost: writing libraries is fun (for me).  Writing a component to be incorporated into larger applications is like making bricks: without finely made bricks, no building can withstand the test of time.  It’s an activity that lends a great sense of satisifaction, and I suspect that in this day and age it will grow some grassroots (read: free) marketing for our business. Collegeman.net should have its own showing of open source wares: concrete software to represent our capacity for development and a repayment for the many contributions by the open source community to our own efforts.

The most practical reason is that I don’t like what the community has to offer in the way of PHP ORM.  There are several features of the PHP programming language that lend much speed to the development process.  My goal is to embrace those features, generate less code, and create a sound framework upon which applications can be more rapidly constructed.  Initially we’re going to be committed to getting the framework up and running with MySQL and Symfony.   Future iterations will open the library up to inclusion within multiple frameworks and for persistence into multiple RDBMS platforms.

You can follow the development of this new library on our Google Code wiki at http://code.google.com/p/sfezmodel.  Presently we are planning our first alpha release for October 26th – my birthday!

Google Chrome Beta Release

Ready for public consumption, unless you’re a Mac user.

Google Chrome – Download a new browser

Update True to form, Google answers their own hype with a heaping helping of Web browser heaven. For being the first day of a beta period, Chrome leaves little to be desired, except perhaps replacements for those great Web developer Firefox plug-ins.

Application performance is every bit as fast as promised. I tested Gmail, Google Reader, and Google Maps, and an application I recently worked on at Clutch. All but Google Maps exhibited dramatically faster response times, and the rendering is thus far flawless. I am impressed and pleased with both the address bar and speed-dial-style home page; and I am pleasantly pleased by the tabs-above-address bar layout of the user interface.

I hope these good vibes will continue with the soon-to-be-released version for the Mac.

Browse the Web with Google Chrome

Google is planning to reignite the browser wars with a special salvo of its own: Google Chrome.  With their focus on Web applications, it is little surprise that this new offering from Google will address many of the issues experienced by Web application users.

Among these next generation process enhancements: multi-threading (each browser tab in its own process), efficient memory reclamation, and a JavaScript virtual machine built for speed and highly refined garbage collection.

On the usability side, Google is introducing modal tabs, a dynamic home page that keeps track of sites visited and searched, pop-up staging, and a number of asthetic enhancements to suggestions in the address bar, privacy, and the appearance of the browser window.

Chrome’s rendering is built on top of the open source Web rendering engine Webkit: the same engine underlying Google’s Android Web browser and competitor Apple’s Safari, with an emphasis on speed.  Their JavaScript virtual machine promises to bring new levels of efficiency and security to browser-based applications.  Gears – Google’s offline application platform – will be installed and ready to go.

Google promises that all of this new functionality, much of it programmed from scratch, will be available as open source.  This is to include its new API that provides a black list of malware and phising domains.

What’s my take on all this hype?

It comes as little surprise that Google – an undisputed leader in Web application development and the promotion of the Web browser as a development platform – would invest in the development of a Web browser.  This gives them an unprecedented level of control over their platform and does so in a relatively noninvasive manner.  The distribution of this product as open source is also no surprise given Google’s commitment to OS and its use of OS components in the development of Chrome.

I am concerned about the addition of yet one more browser into the matrix of cross-compatability; however, Google intends to use their gigantic archive of Web sites and page rank statistics to simulate human usage of the browser.  Apparently they can quantitatively measure the difference between what the browser is rendering and what it should be rendering and use this for test-driven development of the application.

I for one am excited by the whole thing.  When the application is released, you’ll be able to download it from Google’s Blog (http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html).

Older Posts »

Subscribe to Perseverance Trumps Talent