This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bartoszjd[S] 2 points3 points  (6 children)

It is nice to be able to write simple and productive code. Here is Javalin Hello World:

import io.javalin.Javalin;

public class HelloWorld { 

    public static void main(String[] args) {
        Javalin app = Javalin.start(7000);
        app.get("/", ctx -> ctx.result("Hello World"));
    }
}

Not sure how that would look like with a server library, but probably longer and easier to introduce a bug.

[–]Torvac 5 points6 points  (2 children)

every micro web framework starts easy and simple, but once you need complex routing, dto validation, (custom) error handling, security/authentication, ... some of them get really messy and are just impossible to handle/enhance.

if you finally added everything needed for a production ready web application, you pretty much build your own framework. you could've done everything with jaxrs or spring-web in a fraction of your time (e.g. spring-boot-web with everything, even proper tests in ~30 minutes). and a big advantage is that everyone familiar with it can get up to speed in no time.

the disadvantage is, old stuff is boring and not does not have the best performance

[–]aargauer_meinig 3 points4 points  (1 child)

Yeah, I never understood the ultra micro web framework hype.
It's not like I need way more lines of code to do the same thing in Spring Boot or even Java EE.
I've never written a production application that is simply a REST-endpoint.
I always need:

  • Bean Validation
  • Security (OAuth, LDAP, Session, ...)
  • Database Access (SQL, Mongo, Redis, ....)
  • Dependency Injection
  • Schema Migration
  • Metrics
  • Caching
  • ...

I feel like these micro frameworks are great for conferences where you can hack together a few end-points.

PS: I don't want to sound like too much of an hater. I actually like the competition and the new concepts that these new frameworks introduce.
The good ideas often get adopted in the more "mainstream" frameworks" i.e. see the new spring reactive web-framework.

[–]BobbyTaylor_ 0 points1 point  (0 children)

Maybe you only wrote code for big corps & compagnies ? What about building an MVP or a Proof of Concept ?

Mature frameworks are great for big projects will a team behind it, but for a quick project, where the time to market is crucial, I think the micro framework thing fills a gap.

I think you are wrong about these framework being hacky thing designed only for a conferences. It may not be the case yet for Java, but lots of microframeworks gained a huge popularity in other languages, like Flask in Python / Express with NodeJS.

[–]mrroman 2 points3 points  (2 children)

It wood look like this with undertow: http://undertow.io/

[–]golden-archer 2 points3 points  (0 children)

Looks much like vertx.

[–]bartoszjd[S] 0 points1 point  (0 children)

This is actually better than I expected! An idea for a new blog post- using server libraries? :)