What does it mean to be a micro framework? [closed]
Asked Answered
F

4

14

Ruby Sinatra and PerlDancer are called "Micro web framework"?
What does it mean to be a micro framework?

Are micro web frameworks suitable for large projects (say Stackoverflow, e-shopping, real estate management or ...)?
What are the best usage cases for micro web frameworks?

Footer answered 21/7, 2011 at 23:19 Comment(1)
I don't actually know, but it sounds a lot like a nebulous marketing term more than anything else. I bet it's impossible to draw a line between a big "micro framework" and small normal framework.Adel
O
10

There isn't a perfect dictionary definition for "micro framework", but the python micro framework, Flask has a decent explanation here: what does micro mean.

As to whether or not it would be appropriate for a complex website, experience will guide you. As your project grows in complexity, you may find that you outgrow the micro framework, and may prefer something that promotes better code organization in a large project. But if this is a side project, don't let the fear of outgrowing it prevent you from starting with a micro framework that you're comfortable with.

Octodecimo answered 21/7, 2011 at 23:42 Comment(0)
S
9

A micro definition: To me, a micro framework does less for you and leaves more freedom on how you write and organize your code.

When using Rails, you pretty much have to use a relational DB and use the conventional naming and directory structure it builds on. It also includes much more functionality out-of-the-box.

Sinatra, on the other hand, lets you have the flexibility you want and pick-and-choose your functionality. For example, I used Sinatra to create a CouchDB-backed website/service while doing so in Rails would have been much more complex.

Snashall answered 21/7, 2011 at 23:42 Comment(2)
Rails is easy to use with non-relational databases because it's so pluggable. Your overall point--that something like Rails is complicated and opinionated compared to a micro framework--is reasonable enough, but that little bit of misinformation detracts from it.Lavena
Was speaking from experience, but that was a few years ago... situation's probably changed :)Ptisan
U
1

I'm a big fan of Sinatra and have used it on several small projects. If you don't have a lot routes or resources within the project, it is a good solution. There are also a lot of plugins and helpers out there that will help with the "cookie-cutter" code and reduce your workload (and keep the code-base smaller).

Keep in mind, you don't get things like migrations or models out-of-box. These features can be introduced to your project with ease but you may find yourself reinventing the wheel in a lot of cases.

As I am writing this I am actually porting a Sinatra based project to Rails 3.1. The project started small but slowly became to difficult to manage as I added features over time.

Uppish answered 21/7, 2011 at 23:34 Comment(0)
C
1

Well there isn't one true answer to this one. I've been around quite a bit and developped a couple of frameworks myself, so what I'd say is that a micro-framework is mostly a routing library coupled with a security lib and a bit of syntactic sugar and stubs to extend it later on. Lately micro-frameworks have been used a bases for bigger ones, like Silex and Symfony, so you cant really outgrow those anymore.

Cobos answered 15/3, 2013 at 21:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.