Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Basset. Now what?

by jimt (Chaplain)
on Aug 04, 2006 at 19:46 UTC ( [id://565734]=perlmeditation: print w/replies, xml ) Need Help??

Two years ago I open sourced my application framework, Basset. Why's it called Basset, you ask? Well, it's very agreeable, easy to get along with, and likes set routine, just like basset hounds. Besides, I wanted something catchy and snappy and not JASA (just another silly acronym) and was inspired by Maypole's name.

Plus I just like basset hounds.

A year ago, I put it on CPAN. I'd refrained at first, for several reasons, but opted to finally put it on there, cluttering up the namespace though it does. Ho hum.

And the question that comes to mind is...now what?

What Basset is

Basset is the set of tools that I've been using internally for years and years and years and years. It has the advantage of a lot of maturity behind it, but the disadvantage of being exactly what I want it to be, which may not be what you want it to be. This is not a new, immature product. It's been around a long time and is pretty battle hardened. Good chunks of most modules even have really good test coverage. I think it's perfectly easy to use, but I'm biased. A former co-worker described it as cumbersome, but functional.

He also described it as "There's only one way to do it." My goal was to establish a set of tools and routines for myself to ensure solid consistency across my software. One of the gripes I have with CPAN is that everything is done differently to the point that tying disparate modules together can be a real pain in the ass. If your root object class uses inside out objects and your persistent layer uses arrayrefs and your logging module uses exceptions and your email rountines use error codes, then knitting it all together is a real nuisance.

With Basset, I was guaranteed that everything always plays together by the same set of defined rules. But I took it a step further - I made the rulebook user definable. So if I want to use error codes and you want to use exceptions, that's cool - flip a bit and it transparently swaps. If you want to use Class::DBI for your persistent layer and I want to use DBIx::Class, that's cool - flip a bit and it transparently swaps. Basset wants to ensure that you always play by the rules, and it suggests a rulebook, but doesn't care if you change the rules as you go along.

It's a generic application framework. Documentation is decent, though not outstanding, I don't think. There's a reasonably good tutorial up on my website at Basset Software to introduce you to things, but the introduction assumes that you use my rulebook and doesn't yet go into defining your own.

So you start off by subclassing off of Basset::Object. That gives you constructors and error handling and abstract factory capability and a few other things. You hang your class hierarchy off of here and you know that everything inside of it behaves the same way.

You don't like something? You change it. You can even change it inline and have your other subclasses care about it. The term I use is "injected inheritance", which may or may not be common. Apple calls it "isa swizzling" in their frameworks. For example,

Say when an error occurs, you also want to log it to a file. You simply subclass the root object and add on logging.

package My::Object; our @ISA = qw(Basset::Object); sub error { my $self = shift; #log interesting things return $self->SUPER::error(@_); }

Or words to that effect. This works swimmingly, unless you download another object created by another user. They'll subclass directly from Basset::Object and bypass your logging. So you're back where you started - error handling works differently for different objects.

Basset gets around this by subclassing off of object types, not objects. So instead, you define My::Object as the root object type in your config file, and have your objects inherit from the root object type, not a particular class. Blamo! Your newly downloaded module gets your error handling, too.

There's more neat stuff like that throughout the framework, for my definition of "neat", of course.

What Basset isn't

Basset isn't just another persistence layer, though it has its own persistence class included. Sure, I could have just used Class::DBI or Tangram or Alzebo or whatever else, but I wrote my own (years ago) and refined it to my current liking. If you want to use it, that's great. If you don't and want to wrapper Class::DBI and drop that in instead, that's great. Again, Basset doesn't demand you follow its rules, it just demands you follow rules. But don't dismiss it because there's a persistence layer, it's just a bundled example of one that you can try.

Ditto on the templating system. Don't use it, I don't care. But I think they're both useful pieces of code, so I distributed them with the framework. I look at other app frameworks and templating engines and persistence layers for concepts and ideas, maybe someone else would like to look at mine. Share and share alike.

It's not a speed demon. It's fast. Really fast, I think. Especially compared to how it behaved years ago. But it's still a framework with some overhead and you can do things faster on your own if you do it directly, but the slowdown is manageable. Basset hounds are also a little slow, but manageable. Plus, the speed that they can produce in some instances can surprise you.

Basically, it's not just its individual parts, it's how the parts operate together that's the neat part.

So now what?

I feel like I'm throwing a party and nobody's coming. So how can I drum up support? While it's my project and I'm always going to be the gatekeeper, I really want to open it up to the world and get feedback and suggestions from everyone.

For example, Basset::Object::Persistent used to have an old, clunky, ugly (I say now) concept of attaching multiple tables to an object. The same former colleague I'd mentioned above made a big fuss about it and sang the praises of Class::DBI's has_a syntax. I looked it over, thought about it, decided he was right, and implemented something similar. Along the way, I added in transparent multi-table support so that one object can transparently map to multiple tables, not the 1-1 constraint you usually have.

And I never would have made that modification without his prodding. Now, he had to use it (we were using it at work), so he's a special case. But the rest of the world? You guys have a choice. Sure, I think it's neat, but I'm the proud father here. What, if anything, could get you guys interested in looking at it? I know that right now it's just Yet-Another-App-Framework. What'd be exciting? What would make you think, "Hrm, that might be worth checking out?"

I want to grow this thing into a community and hopefully make a lot of people's lives easier, but I haven't a clue how to do it.

Where should I start?

Replies are listed 'Best First'.
Re: Basset. Now what?
by zentara (Archbishop) on Aug 05, 2006 at 12:40 UTC
    Post it frequently on freshmeat.net, and have a good demo page.

    If you can afford to go to Perl conferences, deliver talks on it's usefulness, with slides, etc.

    But remember, "If you build a better mousetrap, the corporations will find you and steal your idea" . :-)


    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
Re: Basset. Now what?
by davido (Cardinal) on Aug 05, 2006 at 05:00 UTC

    Why's it called Basset, you ask? Well, it's very agreeable, easy to get along with, and likes set routine, just like basset hounds.

    My experience with bassets is a little different. Ours (may she rest in peace since the mid 1990's) was stubborn, opinionated, and liked any routine that involved unauthorized access to human food. She was a wonderful dog, but not so agreeable... she seemed to love to disagree. Maybe that's what we (at the time, teenage) kids loved her so much. ;)


    Dave

Re: Basset. Now what?
by tphyahoo (Vicar) on Aug 05, 2006 at 09:52 UTC
    make some kind of neat demo tool, or better yet a real application, built on the framework, and open source that. hope that it inspires people to learn your framework so they can copycat into something similar!
Re: Basset. Now what?
by doom (Deacon) on Aug 07, 2006 at 18:56 UTC
    What, if anything, could get you guys interested in looking at it? I know that right now it's just Yet-Another-App-Framework. What'd be exciting? What would make you think, "Hrm, that might be worth checking out?"

    I want to grow this thing into a community and hopefully make a lot of people's lives easier, but I haven't a clue how to do it.

    Where should I start?
    Um... give up? That was my first thought. You took too long to release it, and in your rather long and verbose discussion here you have very little to say in it's favor compared to all of the other guys out there that got theirs out first.

    I realize you're asking us to tell you what we're looking for, but what do you think? We want to hear about how it'll speed development, and make maintenance easier. And I personally, want to see benchmarks about how it behaves under heavy load compared to other approaches (though for some reason the "web app framework" crowd doesn't seem to be worrying about that).

    Another thing that people like to hear about is success stories... Mason is in use at Amazon, Bricolage is used at Salon. What sites have you implemented with this framework?

Re: Basset. Now what?
by Khen1950fx (Canon) on Aug 07, 2006 at 10:34 UTC
    Hi. I installed Basset. I had a problem with some of the tests, but most of them passed. I'm on FC6 Test 2, so I can't really tell if the problem is FC6 or the test scripts. Altogether, 3/12 test scripts and 24/2216 subtests failed.

    The documentation's ok. I'd like to suggest adding a Basset::TOC, Basset::Intro, and a Basset::Tutorial or Basset::Manual. That would help me out a lot. Otherwise, it works fine.

Re: Basset. Now what?
by Anonymous Monk on Aug 06, 2006 at 08:23 UTC
    You should start by rewriting the FAQ (and later all the documentation) to be clear and concise, instead of a buzz-word soup of long-winded and detailed vagueness.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://565734]
Approved by friedo
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-19 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found