Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

A restful back end

by Random_Walk (Prior)
on Jul 07, 2015 at 06:07 UTC ( #1133505=perlquestion: print w/replies, xml ) Need Help??

Random_Walk has asked for the wisdom of the Perl Monks concerning the following question:

Good day fellow monks,

I am starting a new project, with a clean slate, this is a wonderful and rare delight.

I need to create a back end web service and being a man of the times, I plan to use a REST style API.

The back end needs to provide:

  • User Signup
  • User Authentication
  • Order creation
  • Payment
  • Job Acceptance
  • Geolocation of assets
There will be more, but that's some of the main features.

I do not have to write it in Perl, but that is where I know my way the best, so I am minded to make it so.

I have started looking at Mojolicious, but then thought I'd back up a step and ask for some advice.

  • Is Perl still a good language to use, or am I a dinosaur?
  • Is Mojolicious a good way to build a REST service
  • What other frameworks would you folk recommend I look at
  • Does anyone know of a nice open source project providing some set of the above features, that could get me started?
  • Any other warnings or guidance from those with experience in REST

Many thanks for your time
R.

Pereant, qui ante nos nostra dixerunt!

Replies are listed 'Best First'.
Re: A restful back end
by Anonymous Monk on Jul 07, 2015 at 10:57 UTC

    Yes, Perl is still a good language to use, especially if "modern" practices are used. That means using a recent version of Perl (at the moment I'd say that's at least 5.18), reading the perldeltas, noting that some of the common practices used in old Perls have been updated (e.g. lexical filehandles), using the right modules where appropriate (see e.g. Task::Kensho), and especially using some of the modern frameworks such as Moose/Moo, DBIx::Class, Plack, etc. (where appropriate).

    The three major web frameworks out there at the moment are Dancer, Catalyst, and Mojolicious. Personally I like Mojolicious, but have heard plenty of good things about the others as well.

    Perhaps you could also have a look at Galileo - "A simple modern CMS built on Mojolicious".

Re: A restful back end
by skx (Parson) on Jul 07, 2015 at 08:38 UTC

    I'm in a hurry so I cannot write as much as I wish, but I would like to say that mojolicious is nice, but you might also want to consider "Dancer".

    There is a lot of good documention, cookbooks, and tutorials, either on CPAN, or via http://www.perldancer.org/.

    Steve
    --
Re: A restful back end
by jeffa (Bishop) on Jul 07, 2015 at 16:31 UTC

    "What other frameworks would you folk recommend I look at"

    I would definitely check out Raisin. It seems to be the "new kid in town" and it looks like it is becoming very popular.

    "Any other warnings or guidance from those with experience in REST"

    Be very mindful of making changes to the API downstream. Many APIs wind up depending on versions because necessary changes to the structure. You would be wise to study existing APIs that are close to the domain you are modeling.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: A restful back end
by SimonPratt (Friar) on Jul 07, 2015 at 13:06 UTC

    The suggestions already provided are very good. I want to add that however you choose to implement your API, be sure to use a standard pattern for your API calls and also take the time to become familiar with Test::More

    Implement and maintain tests for everything - Trust me, a little pain doing this is much preferable to more pain when you make a "small" modification that snowballs out of control

Re: A restful back end
by jhthorsen (Initiate) on Jul 10, 2015 at 08:59 UTC
    I was not able to respond with the complete text (got "access denied"), so I wrote a blog post instead: http://thorsen.pm/perl/programming/2015/07/10/a-restful-backend.html
Re: A restful back end
by BUU (Prior) on Jul 10, 2015 at 08:59 UTC
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1133505]
Approved by kevbot
Front-paged by kevbot
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2021-05-18 21:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (185 votes). Check out past polls.

    Notices?