Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Web app frameworks - I am totally confused!

by Arrowhead (Monk)
on Oct 06, 2003 at 09:16 UTC ( #296892=note: print w/replies, xml ) Need Help??

in reply to Web app frameworks - I am totally confused!

We've used the Template Toolkit to our satisfaction in earlier jobs, so when I went looking for a framework, I wanted one that was based on or could use Template.

I found OpenInteract, but now I regret I did.

Apologies in advance to the author, but here's my list of reasons not to like OI:

  • It is OO, yet it uses copying and renaming of .pm files (and classes!) for code reuse and customisation.
  • It tries to solve problems that I don't have, like deployment. It's frustrating to have to manage perl code using a proprietary command when you've already standardised on Debian and/or Solaris packages for your own code.
  • Hard to debug. If you want to figure out how SPOPS works, you can't just turn on an option to look at the generated code. It's all done using eval "", with no way to get the complete picture.
  • The object-based security model can get in the way if for instance you want to allow users to see some but not all of an object.

OpenInteract is an impressive body of code and I can see how it works for its author. However, I think it suffers from being (mostly?) a one-man show.

So what would my ideal framework look like?

I'd like to try and duplicate the Struts framework from the Java world. Where J2EE just makes me wonder whether I actually need all that complexity, Struts immediately struck a chord. It solves dillemma's that I have had myself, building web apps since 1995.

In short, Struts is Model-View-Controller for the web, with emphasis on really identifying the Controller (and not mixing it with the View).

So I started wondering, maybe I should switch to Java for this kind of application...

But then I took one look at one random class (in this case the implementation of a custom jsp tag which creates a hyperlink) and I saw two screens of code, where two lines of perl would suffice.

So, I think there's merit in the idea of Struts-for-Perl. What do others think?

  • Comment on Re: Web app frameworks - I am totally confused!

Replies are listed 'Best First'.
Re: Re: Web app frameworks - I am totally confused!
by lachoy (Parson) on Oct 06, 2003 at 13:41 UTC

    I'm the OpenInteract author, and there's no apologies necessary. These are all valid and points I wish you would have brought these thoughts up on the mailing list so they'd be in the meme-stream. But here's a few responses. Note that some refer to OI2 which is currently in beta 3 and quite usable.

    copying and renaming PM files: Yep, this stinks. This is a great example of unnecessary overengineering -- it was done so that you could run multiple OI installations in the same Apache/mod_perl process. But who does that? OI2 does away with this entirely.

    deployment: Not much to do about this. It would be cool to have installation adapters for RPM, Solaris, Debian, etc., and it probably wouldn't even be that difficult for installation. (At least in OI2...) But then you have things like packages installing SQL schemas, data and security and it might get a little tricker, although I'm not familiar with how much you can do with Debian/Solaris packages.

    debugging: You're absolutely right about SPOPS being difficult to debug. OI2 uses Log::Log4perl for logging and SPOPS will soon as well. This makes it easy to set debugging levels at a fairly granular level.

    security: This is a design disagreement. My feeling is that doing field-based security will lead you down the road of chaos. (I've vacationed there, awful place.) Not only is it difficult to program, but it's very confusing for users to configure. Instead I've found it's best to split these into separate objects that each have different security settings.

    You're right that it's mostly a one-man show. I think OI2 is more loosely coupled to allow people to work on different pieces as needed. Plus a lot of the needlessly complex stuff is gone.

    It's interesting that you mention Struts because a number of the changes that went into OI2 were inspired by Struts. Since Perl isn't typed like Java there really isn't the need for the Action Form classes Struts uses except maybe for validation and that can be handled in other means. But the handlers that actually execute your application are now object methods, not class methods, and the HTTP request has been broken down into separate request/response objects. (That's more of a servlet thing, but still...)

    Hope that's useful. It would be great if you'd take a look at OI2 -- to help, there's a lot more documentation than OI1 :-) -- and contribute some ideas based on your experiences with other frameworks.

    M-x auto-bs-mode

      Any chance of breaking the dependency between OI2 and SPOPS, to allow people to use Class::DBI (or hand-rolled objects) if they prefer it?

        That's something I hadn't really thought about before. In theory all you'd need to do is satisfy the interface (fetch/save/remove plus the relationships and any custom methods) and you'd be good to go.... It's far too late to think about this right now though, but I'll stick it in the wiki.

        M-x auto-bs-mode

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://296892]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2023-03-25 18:17 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (63 votes). Check out past polls.