Archive for the ‘generation’ Category

REST Pattern

Monday, June 30th, 2008

UNIVERSITY OF CALIFORNIA, IRVINE

Architectural Styles and
the Design of Network-based Software Architectures

DISSERTATION

submitted in partial satisfaction of the requirements for the degree of

DOCTOR OF PHILOSOPHY

in Information and Computer Science

by

Roy Thomas Fielding

2000

Dissertation Committee:
Professor Richard N. Taylor, Chair
Professor Mark S. Ackerman
Professor David S. Rosenblum

PDF Editions

1-column for viewing online
2-column for printing

Table of Contents

Dedication
Acknowledgments
Curriculum Vitae
Abstract of the Dissertation
Introduction
CHAPTER 1: Software Architecture
1.1 Run-time Abstraction
1.2 Elements
1.3 Configurations
1.4 Properties
1.5 Styles
1.6 Patterns and Pattern Languages
1.7 Views
1.8 Related Work
1.9 Summary
CHAPTER 2: Network-based Application Architectures
2.1 Scope
2.2 Evaluating the Design of Application Architectures
2.3 Architectural Properties of Key Interest
2.4 Summary
CHAPTER 3: Network-based Architectural Styles
3.1 Classification Methodology
3.2 Data-flow Styles
3.3 Replication Styles
3.4 Hierarchical Styles
3.5 Mobile Code Styles
3.6 Peer-to-Peer Styles
3.7 Limitations
3.8 Related Work
3.9 Summary
CHAPTER 4: Designing the Web Architecture: Problems and Insights
4.1 WWW Application Domain Requirements
4.2 Problem
4.3 Approach
4.4 Summary
CHAPTER 5: Representational State Transfer (REST)
5.1 Deriving REST
5.2 REST Architectural Elements
5.3 REST Architectural Views
5.4 Related Work
5.5 Summary
CHAPTER 6: Experience and Evaluation
6.1 Standardizing the Web
6.2 REST Applied to URI
6.3 REST Applied to HTTP
6.4 Technology Transfer
6.5 Architectural Lessons
6.6 Summary
Conclusions
References

List of Figures

Figure 5-1. Null Style
Figure 5-2. Client-Server
Figure 5-3. Client-Stateless-Server
Figure 5-4. Client-Cache-Stateless-Server
Figure 5-5. Early WWW Architecture Diagram
Figure 5-6. Uniform-Client-Cache-Stateless-Server
Figure 5-7. Uniform-Layered-Client-Cache-Stateless-Server
Figure 5-8. REST
Figure 5-9. REST Derivation by Style Constraints
Figure 5-10. Process View of a REST-based Architecture

List of Tables

Table 3-1. Evaluation of Data-flow Styles for Network-based Hypermedia
Table 3-2. Evaluation of Replication Styles for Network-based Hypermedia
Table 3-3. Evaluation of Hierarchical Styles for Network-based Hypermedia
Table 3-4. Evaluation of Mobile Code Styles for Network-based Hypermedia
Table 3-5. Evaluation of Peer-to-Peer Styles for Network-based Hypermedia
Table 3-6. Evaluation Summary
Table 5-1. REST Data Elements
Table 5-2. REST Connectors
Table 5-3. REST Components

[] © Roy Thomas Fielding, 2000. All rights reserved. [How to reference this work.]

Kepler a Lua Based Web Development Framework

Sunday, June 22nd, 2008

Lua is a very useful language for many things.  Extending core base code with modules and add-ons have made it very useful in game development but since Lua is table-based it can also be easily applied to web development. Well that time has come, See the Kepler Project for a nice collection of modules that make a good start for web development with Lua.

Kepler is an open source platform that brings the power of Lua to web development. There are a number of great Web development platforms out there but none balances portability, size, power and extensibility quite like Kepler does:

  • Being extremely portable and light means that it can be installed in very constrained devices as much as in providers that limit the amount of RAM and processing time for your scripts.
  • If you ever heard of the customization features of games such as World of Warcraft, think about all that power applied to web scripting.
  • Being extensible means both that we can extend the platform by adding new modules and that the users of the applications that you build can extend those applications using Lua.

Kepler was created by Fábrica Digital and PUC-Rio and is continuously being improved by a core team of commiters (see Dev Team) and lots of contributors (see Credits).

Kepler is free software and uses the MIT license model: it can be used for both academic and commercial purposes at absolutely no cost. See the Kepler License for more details.

Kepler is a platform that uses LuaRocks to offer Modules such as:

  • Page based and MVC XHTML generation (WSAPI, CGILua and Orbit)
  • SQL and XML processing (LuaSQL and LuaExpat)
  • Hash (MD5) and a pair crypt/decrypt
  • Zip files reading (LuaZip)

The Lua community is constantly contributing with more modules that can be used with the Kepler Architecture. Most of those modules are catalogued on LuaForge and new ones keep coming.

Unix installation

Please check UNIX Installation for a detailed view of how to install Kepler on Unix machines (including OSX).

Windows installation

Installing Kepler on Windows does not require any C compiler and should work on any Windows machine with internet access.

  1. Download LuaRocks and install it using install /SCRIPTS c:\luarocks\0.5.2
  2. Add the LuaRocks scripts dir to your system path (the same directory used in the /SCRIPTS parameter above)
  3. Install Kepler and Xavante using luarocks install kepler-xavante
  4. Configure everything using setup-kepler and following the instructions
  5. Use xavante to run Xavante as a tray bar application, or use ‘xavante_start’ to run Xavante from the command prompt. Another option is to run Kepler using CGI

Once Kepler is running, you might want to look at those pages:

The Kepler 1.1 Unix installer can be downloaded from its downloads page. Check the Installation page for more details and for the Windows installation instructions (using LuaRocks).

If you need the binaries for specifics Modules you can also get them from LuaForge, on the module respective project page.

Restlet RESTful Lightweight Kit for Java

Friday, June 20th, 2008

Finally rest for all that boilerplate in Java.  At each turn of lots of Java frameworks you are bombarded with layers.  I felt this long ago and see it in the developers eyes that work with Java.  Java can be easy, it can be RESTful and it will make you look sharp.

Lightweight REST framework for Java

Do you want to embrace the architecture of the Web and benefit from its simplicity and scalability? Leverage our innovative REST engine and start blending your Web Sites and Web Services into uniform Web Applications!

Java is making things more lightweight now with lots of emerging kits that compete with other web ready platforms like Python, Ruby, .NET, PHP etc. After this many years things get bloated and need to be simplified.  I think this will start winning people over in this direction.

The Common Baseplane Method to Caching — memcached

Tuesday, May 27th, 2008

If you have ever worked on a massively high trafficked website, you know that cache is very important to keeping the server count down and being a superhero to your database servers. Cache can be bad and overly optimized but when you hit a certain threshold, relational databases, databases that are dimension modelled for data warehouse, and even server resources get exhausted. At that point you have two options, buy more servers, or more likely, cache read data.

Each platform has their own way to do this, but there is a common baseplane way to do caching, yes even in .NET. That is with memcached. Memcached is a very common and useful tool that makes caching data and cache layers in an application something that can be the same on every platform. The benefit of using memcached is it is open, common and it has APIs for nearly every popular web development platform (and can be wired in easily to platforms that don’t have their own cache mechanism). Why write your caching layer specific to a certain platform when you can memcache?

If you write high performance web apps and don’t memcache, I feel bad for your server budget and your late nights when that ad buy hits or something popular on your site becomes all the rave.

Perl API

An object-oriented Perl module can be found on CPAN as Cache::Memcached or in Subversion (ChangeLog). (GPL/Artistic)

The Perl API takes advantage of the server’s opaque flag support and sets its “complex” flag whenever the object being stored or retrieved isn’t a plain scalar. In that case, the Storable module is used to freeze and thaw the value automatically going in and out of the memcached.

There is also Cache::Memcached::Fast—another Perl client written in C, largely compatible with the original Cache::Memcached. Available on CPAN at http://search.cpan.org/dist/Cache-Memcached-Fast/.

PHP API

There are tons of PHP libraries available, in different conditions. But it now seems there’s an official one:

Python API

The Python client we’d previously released was just a prototype, and we don’t have regular Python programmers on hand. The folks at Tummy.com have took over maintenance. See ftp://ftp.tummy.com/pub/python-memcached/ for the latest versions.

Ruby API

Java API

A Java API is maintained by Greg Whalin from Meetup.com. You can find that library here:

An improved Java API maintained by Dustin Sallings is also available. Aggressively optimised, ability to run async, supports binary protocol, etc. See site for details:

C# API

There are multiple C# APIs:

C API

Multiple C libraries for memcached exist:

  • apr_memcache by Paul Querna; Apache Software License version 2.0
  • libmemcached by Brian Aker; BSD license. This is a new library, under heavy development.
  • libmemcache by Sean Chittenden; BSD license. This is the original C library. It is no longer under active development. You should try libmemcached instead.

Postgres API

The pgmemcache project allows you to access memcache servers from Postgresql Stored Procedures and Triggers. More details and downloads are available at:

Chicken Scheme

Lua

MySQL API

The memcache_engine allows memcache to work as a storage engine to MySQL. This means that you can SELECT/UPDATE/INSERTE/DELETE from it as though it is a table in MySQL.

A set of MySQL UDFs (user defined functions) to work with memcached using libmemcached.

Protocol

To write a new client, check out the protocol docs. Be aware that the most important part of the client is the hashing across multiple servers, based on the key, or an optional caller-provided hashing value. Feel free to join the mailing list (or mail me directly) for help, inclusion in Subversion, and/or a link to your client from this site.

The best part, they support all good platforms and even Lua, and wisely they left out VB.NET, no worries, VB.NET’ers will never know. Only kidding…

Finally, memcached is distributed, most cache layers included with platforms listed above are in process and per machine.  If you are running your code on a webfarm memcached is the only way to go.

Baseplane Tool: Tenjin Templating Library (pyTenjin, jsTenjin, phpTenjin, rbTenjin, plTenjin)

Monday, April 7th, 2008

Tenjin is a great templating library that gets not only cross platform but baseplane ability to make templating very similiar (and FAST) across many languages. pyTenjin and phpTenjin is currently what I am using but there are executions for Ruby, Perl and Javascript.

Here is a list of the Tenjin Templating engines:

Changes
(Python) (Ruby) (PHP) (Perl) (JavaScript)
User’s Guide
(Python) (Ruby) (PHP) (Perl) (JavaScript)
FAQ
(Python) (Ruby) (PHP) (Perl) (JavaScript)
Examples
(Python) (Ruby) (PHP) (Perl) (JavaScript)
Presentation
2007 LL Spirit LightningTalk (full-version) (Japanese)

Here is what the template markup looks like:

This

<table>
<tbody>
<?py i = 0 ?>
<?py for item in ['<foo>', 'bar&bar', '"baz"']: ?>
<?py     i += 1 ?>
<tr>
<td>#{item}</td>
<td>${item}</td>
</tr>
<?py #end ?>
<tbody>

</table>

Produces This

<table>
<tbody>
<tr>
<td><foo></td>
<td>&lt;foo&gt;</td>
</tr>
<tr>
<td>bar&bar</td>
<td>bar&amp;bar</td>
</tr>
<tr>
<td>"baz"</td>
<td>&quot;baz&quot;</td>
</tr>
<tbody>
</table>

Here are some speed results

MacOS X 10.4 Tiger, Intel CoreDuo 1.83GHz, Memory 2GB
Language Template Engine Test#1(sec) Test#2(sec)
Python(2.5.1) pyTenjin (0.6.1) 6.96 5.61
Cheetah (2.0) 20.36 19.82
Django (0.9.5) 71.33 59.80
Myghty (1.1) 107.88 19.30
Kid (0.9.6) 380.24 378.96
Genshi (0.4.4) 560.30 271.69
Mako (0.1.9) 17.78 13.49
Templetor (web.py 0.22) 428.19 61.53
Ruby(1.8.6) rbTenjin (0.6.0) 7.34 4.52
eruby (1.0.5) 12.29 11.53
ERB(def_method) (Ruby1.8.6) 36.73 5.85
PHP(5.2.0) phpTenjin (0.0.1) 5.39 3.64
Smarty (2.6.18) 10.84 10.21
Perl(5.8.8) plTenjin (0.0.1) 10.42 5.72
Template-Toolkit(XS) (2.18) 103.58 26.30
HTML::Template (2.9) 46.70 30.21
JS(spidermonkey) jsTenjin (0.0.1) 19.00 12.98
JS(Rhino, JDK5) jsTenjin (0.0.1) 24.29 19.15
Java(JDK5) Velocity (1.4) 22.80 11.41
Velocity (1.5) 20.01 8.42

Code Generation != ORM, Code Generation IS for the Code Generation

Friday, February 22nd, 2008

Code generation is not ORM (Object Relational Mapping). ORM is not code generation.

These are two separate ideas. ORM is part-of code generation but code generation is super to ORM.

I get in discussions with people that are strongly against ORM mostly due in part to Jeff Atwood’s post that ORM is vietnam. Yes it can be, and ORM is only for highly tailored teams and projects and creates bulk and uncontrollable code bases. BUT, code generation is valuable and here to stay.

Code generation can be a templating system that outputs code that exactly is the way you would write it and generate unit tests, db field mappings, basic skeletal architecture, maybe a data layer that accesses tables and views or any one of those things from a custom, open source, standard or commercial templating system.

Code generation can also be macros, db migration processes (SSPI or DTS or PL-SQL or n), adding a new file in yoru IDE (VS.NET/Eclipse/FD templates), configuration files, refactoring tools, and many other things. Code generation is a part of life for a programmer or engineer. In fact if you dont’ start getting a handle on the code generation systems that are evolving then you will be that much more without a solution when platforms advance.

Code generation can also be team building because many times people against code generation are hand coders. This is fine and this works great for one programmer. When you add programmer++ to any single team all of a sudden “styles” come into play. Code generation and basic framework or API code structures should be similar in a team environment so that others have a base layer of knowledge they can get up to speed on. Code generation brings the style battles and architecture to the forefront on how code should look in an organization. As you can imagine when you give 50 architects or developers the lead, you will get 50 different was of doing things, some good, some bad. Code generation ensures at least a basic structure of code and apis that can be used. Team integration is hard, code generation usually goes hand in hand with this if it is as small as new file templates in an IDE or a macro all the way to entire api framework generators.

It is important that code within the same project look and act the same. Same styles, same conventions, same architecture. One way of settling this is having code generation that everyone agree upon that can help at least structure projects the same, even if implementation and behind the API layer things are like the wild wild west.

Code Generation > ORM

Code Generation is usually guilty by association. We are hoping to change the perception, but again code generation is really only needed when you get beyond the single programmer mindset, or when you start to make a product family or open source.

Code Generation != ORM, Code Generation IS for the Code Generation

Baseplane Tools: OpenSocial Wrappers and Add-on Services

Saturday, February 16th, 2008

Markets of many things have a period of innovation and experimentation opensocial.jpgthrough normal human trial and error, record response, adjust feedback loops. Over time, certain market standards emerge.

For social networks these market standards are profiles, friends, messages, blogs, pictures, and other custom handlers. OpenSocial has emerged late 2007 and is a great example of where after a period of time, a standard baseplane platform emerges and makes it another stepping stone to a further period of innovation and experimentation through normal human trial and error, record response, adjust feedback loops by combining and allowing a protocol to expose and consume data for OpenSocial. This could help many smaller or quickly developed communities get setup quickly, and it will also create social network giants that own the data. OpenSocial from Google was released after Microsoft signed with Facebook. Google came back with OpenSocial that got lots of attention and respec, also a move for Google to own the information and data standard. Then Facebook got forced to open up the apis to provide almost the same functionality, but no OpenSocial. Sometimes you need toolkits that will help to talk to both systems or many more pluggable ROM generation kits that allow you to integrate into these services such as blogging has the metaweblog apis and do most communication in a RESTful or XMLRPC based standard communication. It has allowed many blogging tools to integrate and help proliferate the platform and the companies involved in constructing it such as Wordpress (Automattic), MoveableType (SixApart), etc. There is great value to having open standards and market standards that allow the platform to flourish.

The baseplane code generation BOM (baseplane object mapper) has a ROM (rapid object mapper) both in development that can map your objects or existing applications to share along the OpenSocial standards (roadmaps and tests coming soon). We have many more ROMs that allow layers to be added to your code generation and custom manipulation of that work that have been built after 12+ years of experience in enterprise development. The great thing is the ROMs are custom, meaning that they follow your coding style and how you want things. None of this dictator like ORM systems, this is the reverse to that. They can integrate with existing code and they are not THE platform, they help you shape one though. More on this as the BOM is dropped.

The good news is more platforms are emerging, the bad news is there is much to learn and become an expert on.

Baseplane has launched

Saturday, February 9th, 2008

baseplane is a technology tentacle of drawk, a digital design and development company that produces web applications and games.

The goal of baseplane is to deliver tools that help developers, users and creating a level playing-field in a world of software where platform and company religiosity is breaking standards, simplified software entry points and going against the main rule of software, to minimize complexity.

With such great changes in software happening and so many platforms to consume, tools to simplify and make broad platforms to help manage bigger services it is key to take control of these services as the web generations advance.

baseplane has tools to help with social networks (Open social wrappers and other services), blogging aggregation (XMLRPC, metaweblog), code generation (data, to activity to apis to services to service modules like JSON services), consistent architecture spanning multiple platforms (.net, php, java, actionscript (as3) and ruby,python.

Stay tuned!

Your Ad Here
Your Ad Here


baseplane – technology platforms is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

Unless othewise specified the content in this site is licensed under a Creative Commons License
Your Ad Here Your Ad Here Your Ad Here Your Ad Here