

Introducing a new Java framework for web development: Micro - florinpatrascu

Micro, for short: (μ) or Mu, is a modular Model View Controller framework (MVC Pull) for web development, and it was designed with simplicity in mind. Compared with other Java web frameworks, Micro doesn't force you to use the Java language for creating dynamic content, nor does it pigment your code with Java syntactic metadata or anything like that. With Micro you can start developing your web application right away even if the only content your site has is plain text or Markdown documents; you don't need Java for that. Micro uses Java under the hood, providing you the support that is specific to the web development: localization, template languages, scripting support for more advanced use, and a modular way to extend your dynamic content with controllers written in Java or using scripting, such as: Beanshell, server side Javascript(Rhino), JRuby and more.
Micro is distributed under the Apache 2 license and it is available as a Github repository: https://github.com/florinpatrascu/micro<p>Documentation: http://micro-docs.simplegames.ca, a Micro web application using Markdown for formatting the content; work in progress and available as an open source project too.<p>While still in beta, we believe you will find Micro interesting to work with and you are more than welcome to try it out and send us your feedback.<p>Thank you!
======
doktrin
Very interesting. I've been playing around with Spark a little as of recently
(Sinatra inspired minimalistic Java web framework). I think Mu may allow for
some out-of-the-box functionality that Spark lacks.

At the end of the day, though, I'd be happy working in a Java framework
wherein the experience didn't feel like I was forcing myself to write Java
code. It's just such an uphill battle when the dev experience of
(rails/node/django/webapp/web.py) is radically different from just about
everything Java has to offer. The lack of a sane package manager, for one, is
a major downer.

~~~
eropple
You may not _like_ it, and it has its warts, but I have trouble not calling
Maven "sane".

~~~
doktrin
Perhaps I'm judging it according to an unfair standard, and I certainly don't
have the intention of getting into a language war. However, I personally view
Maven (including but not limited to its config files) as quite _in_ sane.

When compared to, for instance, NPM or Ruby Gems, I can't honestly say I've
found much to like about the Java ecosystem. Part of the problem, of course,
is that unlike in the case of the aforementioned two, build & dependency
management in Java-land is quite fragmented (ant, maven, gradle, etc.).

------
idleworx
Interesting. Will check it out.

How is this different from the recently released Play framework. And can you
give us more details as to why it should be used over SpringMVC or frameworks
like Play?

~~~
mahmud
I really hope someone picks up Play 1.2.x and maintains it. The Play 2.x
alleges to be bi-lingual, Java and Scala, but it's pretty much an Scala
version of Play.

~~~
kirang1989
I've tried asking people about adding new features to the Play 1.2.x code, but
the developers have firmly said that they would no longer add features to the
1.x line :(

~~~
mahmud
Play is begging to be forked, specially as the developers' vision diverges
from that of Play 1.2.x users. We have a big ERP app built on Play 1.2 and
have no interest in moving to Scala and 2.0. Our version of Play is, for all
intents and purposes, a fork.

------
ollysb
This looks like an interesting project, I'll be checking it out for sure. I
realise it's early days but I want to encourage you to take a look at the
excellent docs that sinatra provides in <http://www.sinatrarb.com/intro>. One
of the recurring problems with docs for java projects is that they spend a lot
of time talking about how the framework works. The great thing about those
sinatra docs is that they're focused on telling you how to do things. As a
user of the framework this is great as generally I'm trying to build something
and just want to know how to do it as quickly as possible. Having great docs
means that more people are going to use your project so it's an area where
your efforts will really pay off. It looks like a great project and I look
forward to using it.

~~~
florinpatrascu
thank you for feedback. The µ docs site is trying to satisfy the Designer and
the Developer, two very important roles in my framework design strategy. You
are very right about Sinatra and I will definitely add more examples. Counting
on the community to improve the docs as soon as µ gets more traction, this is
why the docs site is open source too :)

------
Ingon
I come to think that the main issue with doing web with Java is the inability
to do auto reload. There is somewhat way to do this in case of using remote
debugging, but it works only on method level. And even when this works, most
of the Java tooling actually sits in the way of this. For instance web
servers/applications, frameworks and build systems.

However having the framework in Java and actual web app logic in some dynamic
language works very smoothly - I've done something similar with JS (Rhino)
where the server actually takes care of auto reload and module system. Not
really finished but: <http://code.google.com/p/sodejs-java> (wow maybe I
should move it to github finally).

~~~
florinpatrascu
I truly understand your point, and this is why Micro is offering a flexible
scripting support. You can quickly prototype your business logic without
needing to restart the app, which BTW, it only takes a few seconds. Using
Beanshell, for example, allows you to develop and test the business logic and
then transfer the code to Java if need be.

However, I am currently working on integrating the JCL
(<https://github.com/kamranzafar/JCL>) library, recently released under a dual
license by its author; it used to be LGPL only. This way I hope I can offer
the class loading support at runtime, like Play is doing it, for example.

------
viralbajaria
This looks cool. Will give it a try soon. One comment I have is regarding the
jars in the github repo, would you not benefit by using some kind of
repository to pull down the jars when compiling (eg. sonar, maven central,
clojars etc.) and remove all those deps from there and allow users to use
their modified versions if needed. that will also reduce the size of your
repo.

Also have you looked at dropwizard (<http://dropwizard.codahale.com/>) it's
really simple to use. Would like to know your thoughts on that and also how
your framework compares to theirs.

~~~
florinpatrascu
dropwizard looks very cool.

I believe more and more that Micro is talking to a specific audience, where
the non-Java users have an important role too in the development of the site;
Designers, Content managers, etc. With Micro they can prototype quickly before
even calling for dev support. I am glad that when I compare Micro with similar
frameworks, I realize how small Micro is:) And I truly like it this way. Sure
Micro is lacking the persistence support for now (many other features too,
probably) and it will be hard to compare it with other frameworks from this
perspective. However, Micro is modular and can be expanded easily! (I am
searching for a light ORM that I could add as an optional extension;
activejdbc, maybe?)

Honestly, I see all the other similar frameworks as options, not as
competitors. Let the users compare and choose based on what they want to
accomplish. Maybe they'll use ... I don't know ... Play, to randomly pick one,
for building an awesome e-comm web site, but would they use it for developing
a .. blog, or a fast REST service front-end layer let's say?! The Ruby world
is full with good examples where devs/designers are swinging between the fat
Rails and the slimmer Sinatra/etc., shouldn't we be glad we can start doing
the same in Java?

;)

~~~
viralbajaria
Thanks for your reply and your thoughts on the different frameworks.

Totally agree about giving better options to dev quickly in java too. There
are so many times when I just end up using python to dev quickly and make a
proof of concept web api and then when I have to interface with JVM systems, I
end up writing thrift interfaces to keep my original python code around and to
allow me to do quick changes to the api.

I tried dropwizard and it really makes it easy to write a webapi and is really
fast. With that said, I will play with Micro very soon and let you know how it
went.

------
AbhishekBiswal
Awesome! PS : The favicon looks like the uTorrent icon. :P

~~~
florinpatrascu
Thank you. I hope the uTorrent guys don't mind the resemblance of the two
favicons. The Greek letter μ is universal. I'll change the colours if need be
:)

Thank you for pointing it out.

------
ubersoldat2k7
looks good, I like the option to select different template engines. On the
other hand, your i18n approach is not correct, since you are using only the
language and not the country code: en_GB is different than en_US in lots of
aspects, i.e. currencies. Internationalization is the first thing I tend to
look at a framework and many fail on it.

~~~
florinpatrascu
Lack of examples, sorry. Country and Language are both supported. You can
create the following properties file: messages_en_GB.properties, and you have
a language _and_ country based translation!

I will clarify this aspect in the docs, many thanks for catching that!

------
moondowner
I have one question: How is security being handled? E.g. Setting basic auth
for a REST service or form-based login on a webapp?

~~~
florinpatrascu
I will add an example. My goal is to leave the framework as lean as possible
and add functionality by using various extensions. I can see the security
functionality added as a µ Extension enabling a set of filters and specific
web pages; ala Devise. The Extensions allow you to create a completely
independent "mini-site" and inject its functions into the main app. With
extensions you can add your own filters, routes, controllers and specialized
dynamic _content_ /web-UI. Please have a look at:
[https://github.com/florinpatrascu/micro-
extensions/tree/mast...](https://github.com/florinpatrascu/micro-
extensions/tree/master/cache_admin), as an example implementation of the
aspects mentioned above. I see something like Devise being built this way.

~~~
moondowner
Thanks for clearing it out!

