Pancake Stacks… A great tasting blog

Welcome to my blog about pancake :)  Tasty Tasty Pancake.  I’ll get into what Pancake is shortly, but I thought a little background might be in order.

Some of you may remember me from the Merb framework.  I was privileged to work on the Merb framework for a significant amount of time.  We had great growth and had some great ideas, implemented some really good stuff.  ahh.. great times…

Well since the announcement of the merger with Rails, I started looking at developing Rails.  Unfortunately the ideas and direction that Rails is going for Rails 3, whilst awesome, is not the direction that I wanted to go for my free time project.  The idea of fully mountable applications was a very strong lure.

I really wanted a way to mount applications, to have small, focused pieces of code that are loosely coupled.  I don’t just mean loosely coupled pieces of the framework, but also loosely coupled pieces of application code.

We really started to see this with Merb Slices and Rails engines.  Unfortunately, these just don’t take it far enough.  With these methods you cannot just pick up an application, and mount it inside another application.  They’re not good rack applications, and not really able to stand on their own two feet as applications in their own right.

There is something that does allow us to do that though.  Rack.  Rack allows us to create extraordinarily modular code.  The fact that Rails, Merb, Rameze, Sinatra, Rango and other frameworks are all built on Rack is telling.  Rack built in such a way that code re-use and mountable applications and sub applications are natural within Rack.

So, since shortly after the merger, once I realised that Rails was not the project for my spare time, I started working on a project that implements the ideas I had for creating mountable applications.  The applications should be self contained rack applications, able to function as gems, able to pick up an entire application and mount it inside another, able to inherit the whole application, take care of the low level plumbing, and lastly, let you create your own type of application when required.

Pancake

About these ads

2 Responses to “Pancake Stacks… A great tasting blog”

  1. Mike Moore Says:

    I’m also intrigued by mountable apps. I was hoping Rails 3.0 might make this more of a reality, but now I’m not so sure.

    How does Pancake handle cross-app communications? For example, if my master stack has a blog app with comments, and a forum app, how do they both share the same user from the authentication app?

  2. hassox Says:

    When you mount a stack inside another, they’re all in the same process.

    So if you had a UserStack with a User model like UserStack::User, then this is available globally. UserStack::User.all

    Alternatively, in YourStack you could do this

    class YourStack < Pancake::Stacks::Short
      User = ::UserStack::User
    end
    

    This would allow you to reference it as User inside that stack. By doing this you don’t step on other stacks toes, and everything should be safely namesapced.

    Does that help?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: