11 ms·
Jodd – The Unbearable Lightness of Java
- mooreds 12y agoI think there is a huge need for these kind of frameworks. They combine the convention over configuration productivity and tooling that rails and its clones provide, while letting users tap into the massive java ecosystem. Others like this include dropwizard and spring boot, but there's always room for more. Java ain't perfect, but a lot of hard problems have been solved for the ecosystem and building on top of those solutions will save teams time and money.
- cheald 12y agoThat's the same reason I use JRuby so heavily - I can use the entire Java ecosystem, while claiming the productivity benefits of Ruby.
- mooreds 12y agoI haven't done much with the other JVM languages except play around with them (did work with a small jython project about 10 years ago...). Have you encountered any impedance mismatch? Or weird cross language bugs?
- infraruby 12y agoJRuby converts values (Java primitives <-> ruby Numeric, java.lang.String <-> ruby String, etc.) sometimes with unexpected results. JRuby does not wrap primitive values, or provide values that behave like primitives, but you can add that: https://rubygems.org/gems/infraruby-java https://rubygems.org/gems/infraruby-java
- kyllo 12y agoSame for myself and Clojure. Better coding productivity, easy Java interop for more libraries, and the deployment story is a no-brainer.
- dkersten 12y agoMe too. What I like about Clojure (and other JVM languages) is that I can choose how much I want to take part in the JVM ecosystem. There is usually a spectrum from pure-clojure <---> clojure-wrapping-java <--> pure java and I get to choose where on that spectrum I want to or need to be based on the needs of my project. Since the Java ecosystem is huge, this gives me a lot of confidence that most of my needs will be met by existing tools.
- smoyer 12y agoJava's enterprise system has actually trended towards the convention-over-configuration of RoR since it was heavily revamped as JavaEE 5 (and obviously renamed). JavaEE today is heavily dependent on meta-programming and containers like TomEE and JBoss can be built in minimal configurations. I think Jodd is interesting in the same way NodeJS is interesting. If you're more comfortable building your framework from the ground up, you end up adding only those pieces you require. If you're happier having an entire application server at your beck-and-call, start with a full application server and (if necessary) remove what you don't need.
- bronson 12y ago> Jodd is set of Java micro frameworks, tools and utilities, under 1.5 MB. Curious, what do they mean by 'micro'?
- ipedrazas 12y agothat's exactly what I thought. What I would like is something like those JS frameworks where you can choose what you want and generate the lib that suits your needs. Customisation over configuration.
- tokenizerrr 12y agohttp://jodd.org/download/ http://jodd.org/download/ When using maven you can pick and choose the modules you want.
- ipedrazas 12y agoI know, I was talking about having a simple ui where you check check check and "pom" you have the libraries that you want. Edit: The ui generates the dependencies for your pom. I know how maven works, and it's a pain to copy all those xml snippets in your pom.
- saryant 12y agoBut... that's the point of Maven and other package managers. Why does it need a UI like that? Unlike JS, the tradition in Java development is to use managed dependencies rather than download JARs for everything and throw them in /lib.
- curun1r 12y agoMaven needs a UI because of its pathologically-verbose XML syntax. Compare a pom.xml with its Gradle equivalent...only one is designed with humans in mind.
- matdrewin 12y agoI love this. Java may be verbose at times but it's still very easy to understand, fast and stable.
- snambi 12y agoJava is verbose for a reason. It is easier to modify and run code that is written decades ago. It still works. Being concise is good for the first time. If someone needs to fix the "concise" code years later, the only option may be to throw it away and write it again.
- yummyfajitas 12y agoThis is not about conciseness, it is more about lack of language evolution. Older, purely functional haskell ocaml or scheme is quite readable and quite concise. The main place where older code in readable languages (e.g. not J, common lisp, Perl) becomes hard to read is when new language conventions have replaced the old.
- eternalban 12y agoYou should temper that first sentence with an 'only'.
- frostmatthew 12y agoI completely agree that much of the verbosity allows the language to express more, e.g. looking at a method signature in Java I know its visibility, what (if anything) it will return, what types I can/should pass it, and what exceptions it can throw...compare that to Ruby where the signature alone doesn't tell me any of that. But there's also a lot of verbosity that adds no (or very little) value, e.g. System.out.println() instead of something like just println() or the several lines of boilerplate needed to run something in a new thread.
- JustSomeNobody 12y agoJava desperately needs more of this. It's a good language and a great platform. A lot of people don't want to look at it because they've heard (or experienced) horror stories about the huge frameworks. Enterprise development doesn't have to be that way!
- untog 12y agoI've long thought the same about C#. I haven't worked with in years now but I loved it when I did, and thought the reputation given to it by horrific enterprise development was never deserved. You can be amazingly concise with that langauge.
- rdtsc 12y agoI just got use it on Linux via Mono and gotta say, it is a pretty nice language. I used to dismiss it because of Microsoft's influence and its being tied to thier .NET. But recently due to Microsoft open sourcing part of it, hopefully Mono will pick up some more change, and I think there is some space for server side C# on Linux.
- Locke1689 12y agoWe're bringing CoreCLR to Linux/Mac (in the open) as we speak so hopefully you won't have to worry about ever being a second class citizen.
- rdtsc 12y agoWhat happens to Mono then, are you talking to them?
- jdmichal 12y agoThe .NET team has always been on friendly terms with the Mono team. I'd imagine the Mono devs will either keep doing their thing or will merge into the mainline at some point. There's Java VMs that are even commercial, as in people pay for them. I'd imagine that there's certainly enough space for a couple competing CLR platforms.
- csense 12y ago> Designed with common sense Disclaimer: I have nothing to do with this project. It looks interesting though.
- this_user 12y agoI'm not sure why I would need this when Java EE does most of this already. The Enterprise Edition has made a lot of progress with version 6 and 7 and greatly cleaned up the XML descriptor nonsense and instead relies on convention over configuration and annotations where necessary. Things like CDI for DI, JAX-RS for webservices and JPA for persistence just work out of the box with minimal configuration. As far as web pages go, JSF works well and is nicely integrated with the other technologies. But server-side web applications are obviously outdated in 2015, you could easily get something like Angular to work with the Java backend and ditch JSF.
- tajen 12y agoYour comment should have been the first one of the discussion page! because it's nice that there's a default standard like Java EE. However... What's painful with Java EE is the time it takes to understand it. Please correct me if I'm wrong, because I've never got around it, but it takes 5 years of experience to build an app using CDI, JAX-RS, JPA, JSF, JNDI. For each of them you need to choose the implementation provider (Hibernate, Jersey if I'm correct?) and configure it, then you get bugs like the application isn't aware of your JPA and you don't know why, because the spec is circonvoluted enough to be powerful but then takes months to understand. Whereas some frameworks like Play Framework can be learnt in 2-5 months. This is my feeling about Java EE, but have I been in bad luck with my experience? Is it supposed to be quick to get a canonical-JEE app running?
- ExpiredLink 12y ago> For each of them you need to choose the implementation provider ... or simply use those that come with your certified application server.
- eternalban 12y agoTo understand JEE you first need to align with the motivation for the platform: distributed component oriented systems for an heterogenous enterprise environment. The second preliminary is to fully grok why indirection is necessary for loosely coupled component systems. JEE is built on a set of canonical indirection layers. The rest is simply a set of orthogonal specs -- none in anyway intellectually or technically challenging. Building a tutorial full stack JEE app should let you see and touch most of these layers from client to backend. It is a good thing that the new hotness in coding is ignoring JEE ..
- abalone 12y agoCool, how does this compare to DropWizard? I know DropWizard is like a distro of select "best" projects out there, glued together with some configuration and instrumentation code. That makes them easier to use while leveraging the battle-tested-ness of established libraries like say Jackson for JSON. Is this more of a "built from scratch" set of frameworks? How battle-tested are they?
- devonkim 12y agoDropWizard is mostly meant for creating a set of conventions to production-ready applications with operations-friendly things like instrumentation hooks. Jodd is oriented more around simpler libraries for doing what people have oftentimes used heavyweight frameworks for (not in terms of performance though necessarily but in terms of mental efforts and scaffolding required to get a MVP out the door). You could use both frameworks together because they have almost orthogonal concerns and both being minimal don't step on each other's toes. Jodd in itself could work for not needing an app container by using something like Winstone (Jenkins is built with it) for deployment models closer to systems like node.js or Flask and Sinatra that emphasize minimal scaffolding to make it easier to horizontally scale a system by just deploying more dumb nodes. I've seen Jodd used in production systems and just never seen a stacktrace fail to that point so far. I've only ever seen application code fail in itself or fail due to a side effect or misunderstanding of the underlying libraries. I've seen FAR more bugs due to the ugliness of the old Java dateutil libraries than Jodatime, for example, but would we argue Jodatime is more or less mature? Maybe I didn't answer your question but I'd say if you're looking for super stable libraries I'd argue on a time basis alone to just use core Java then. The very point of minimalism from a reliability perspective is to reduce points of failure in code with simply less parts. And really, with the number of deployment headaches I've had resolving random classes across an app container, I could take one less transient dependency in my project.
- abalone 12y ago> I'd say if you're looking for super stable libraries I'd argue on a time basis alone to just use core Java then. Thanks for your reply but I didn't understand this part of it. Core Java doesn't have a lot of this functionality. Are you proposing it would be better to write your own JSON serializer in core Java, for example, than using a battle-tested library like Jackson?
- emmanueloga_ 12y agoThe premise of "micro" anything in Java sounds attractive. I think the JVM is awesome, but often times I go back and forth on my enthusiasm about it because my recollection is that most things implemented for it end up being bloatware (think Eclipse). In the back of my mind I can't stop thinking any given Java app may be using n times more memory than necessary [1]. By the way, I think they went overboard with the marketing. Jodd libraries are all of: efficient - elegant - fast - lightweight - micro - powerful - slick - super - tiny - versatile. It is almost like they picked a random superlative for each piece. I get the point! I see lots of projects going this route on their marketing materials and it ends up being a bit annoying. 1: http://stackoverflow.com/a/632525/855105 http://stackoverflow.com/a/632525/855105
- yogthos 12y agoI don't think Java lends itself very well to doing anything light or micro by design. However, it's perfectly possible to have lightweight stuff on the JVM, Luminus http://www.luminusweb.net/ http://www.luminusweb.net/ is a good example for Clojure.
- emmanueloga_ 12y agoCool, Luminus is micro, lightweight, robust, and scalable. Sorry, I could not help myself :-). I think it would help if people backed their claims with some actual data: a memory/CPU/lines-of-code comparison against mainstream alternatives or standard libraries.
- yogthos 12y agoWell, the docs do start with a walkthrough of a simple application: http://www.luminusweb.net/docs http://www.luminusweb.net/docs You can really judge for yourself how it compares to the alternatives you're familiar with. In terms of memory/CPU there are plenty benchmarks out there such as the benchmarks game site http://benchmarksgame.alioth.debian.org/ http://benchmarksgame.alioth.debian.org/ A small Luminus app will take around 100megs https://groups.google.com/forum/#!topic/clojure/mQbcz82I7iI https://groups.google.com/forum/#!topic/clojure/mQbcz82I7iI so that's pretty lightweight by most standards. In general though while people seem to be obsessed with benchmarks of all kinds, performance is simply not going to be an issue for the vast majority of sites out there. The real question is how productive your stack is and how easy it is to work with.
- vskarine 12y agoI would still recommend going with http://www.ninjaframework.org http://www.ninjaframework.org as it is a lot more complete
- raptaml 12y agoFull ACK!
- enthdegree 12y agoSome day, in the distant future, 2015, development of all new startup projects' descriptions, documentation, websites and source code will be automated using Markov chains. The projects' half-life will be a strong function of its position on the Hacker News Front Page. After dropping out of the top 30, the project immediately decays into an EOL abandoned repo in an archive no one will ever look at. The conspiracy, what most people know is true yet are afraid to admit, is that the Markov chains are trained entirely on past failed code projects. Like cows chewing their own cud, like dogs lapping up their own vomit. Soylent Green is People and Libraries are Pure Virtual. ____ is set of ____ micro frameworks, tools and utilities, under ____ MB. Designed with common sense to make things simple, but not simpler. Get things done! Build your Beautiful Ideas! Kickstart your Startup! And enjoy the _____. is this the future of technology, or has the future already arrived
- zo1 12y agoA shame that you didn't decided to make this very insightful comment on one of the "Library ___ in [Rust|Go]" threads. I'm not trying to bag on anyone, just want us to maybe consider that there is some sort of "underlying" malaise that is causing us to invent, and reinvent constantly. Is it due to us simply wanting to reinvent things, or perhaps due to libraries/frameworks eventually becoming too big that we need to reinvent it in smaller forms and new languages? I don't know, but it needs to be discussed...
- bsaul 12y ago"Is it due to us simply wanting to reinvent things" After observing myself and a couple of developer friends over the last few years, i can most definitely say yes. We are addicted to building our own things, creating layers after layers of abstraction, frameworks, tools, because it makes us feel like we're creating something. What saves some of us, is to have a greater satisfaction seing someone else actually use our things, than creating that thing. And so the goal becomes more "what do people need" rather than "what would i have fun building today".
- pdpi 12y agoTo be fair, the Java ecosystem is quite mature, whereas Go and Rust are relatively young languages, and we still need people to develop all the amenities of modern programming for those languages. Yet Another Java(Script) Framework is more deserving of that sort of comment than The First Couple of Rust|Go Frameworks of Their Kind are.
- edavis 12y agoIf I wanted to learn more about web development in Java, what's a good starting point? Something that can give me a high-level overview, current best practices, and perhaps a simple "Hello World" example. I currently work with Django and Wordpress, so I'm not totally new here. But last time I dived into this world, I could not make heads or tails of it. Java seems like a powerful tool to have in your toolbox, but from what I've found it does not lend itself to be easily picked up.
- hendzen 12y agoOne word. Dropwizard.
- twic 12y agoedavis asked about web development. Dropwizard was built for web services. There is a bit of a difference - user-facing web apps need to do templating, authentication, session management, etc. I see that there is a Dropwizard module for templated views, which looks reasonably nice: https://dropwizard.github.io/dropwizard/manual/views.html https://dropwizard.github.io/dropwizard/manual/views.html I'm not sure how well it supports the other aspects of a web application.
- flaie 12y agoSpring boot.
- twic 12y agoSpring Boot certainly makes it very easy to get started, and to grow your system in the way that Spring envisions. For getting started, there's even the Initializr: https://start.spring.io/ https://start.spring.io/ However, as soon as you want to go off the beaten path (eg to have two databases), Spring starts to become an obstacle rather than an assistance. In this respect, it's similar to Rails or any other large, opinionated framework.
- foolinator 12y ago
- koevet 12y agoBig kudos to whoever is behind this framework for the excellent documentation and the funky site. Still, I doubt I would use Jodd in a new project. The core components (MVC and data access framework) are completely new to me. It seems that they are developed by the same people behind Jodd. I don't particularly like Spring MVC or Hibernate, but Jodd libraries don't seem to be widely used (only 22 questions on SO and no forum or mailing list). Beside the poor adoption, from a cursory look at the documentation, I couldn't find any striking feature. Actually the DB mapping module seems quite convoluted. Also, I don't get this strong emphasis on the framework being "lightweight". Who cares if my project uses 3MB or 20MB of libraries? As others pointed out, also take a look at Dropwizard and Ninjaframework.
- twic 12y ago> that they are developed by the same people behind Jodd Same person: https://github.com/oblac/jodd/graphs/contributors https://github.com/oblac/jodd/graphs/contributors Mr Spasic seems to be something of a virtuoso!
- pimlottc 12y agoHow does JDateTime compare with Joda Time? Date and time classes are extremely tricky to get right, and Joda has been working on it for a long time.
- 0x0 12y agoIt's only the third date library in the standard java runtime, maybe they will get it right this time :P
- twic 12y agoJDateTime appears to be very minimal: https://github.com/oblac/jodd/tree/master/jodd-core/src/main/java/jodd/datetime https://github.com/oblac/jodd/tree/master/jodd-core/src/main... And to repeat some of the mistakes of the past, such as having the classes be mutable, and not separating zoned and unzoned times. It also contains some novel wackiness of its own: new instances of JDateTime take default values for some settings (time zone, whether date arithmetic should be clamped to valid dates, etc) from fields in the class JDateTimeDefault; but these fields are static, not final, and public, so any code in the JVM can change them, thus changing the behaviour of JDateTime objects created by completely unrelated code! As of Java 8, there is a pretty comprehensive and well-designed date-time package in the JDK: https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html https://docs.oracle.com/javase/8/docs/api/java/time/package-... That package was designed primarily by Stephen Colebourne, who designed Joda Time, and essentially constitutes the Joda Time: The Next Generation. I don't see any reason to use JDateTime over this.
- zo1 12y agoAre all the libraries together, combined, under 1.5MB? Or is each one under 1.5MB?
- jodder 12y agoAll together :)
- andretti1977 12y agoDo you want powerful jvm environment and exceptional java ecosystem? Do you want a java-like language (easy learning curve) but want to write less and in a more elegant way? Do you want a powerful scripting language? Do you want to work with consolidated technologies like hibernate and spring but in a more comfortable way? So why don't you choose Groovy and Grails?! I've been working with it for the last 2 years after many years as a J2EE developer and now i can't think to start a J2EE project without it!
- guipsp 12y agoSome people like java.
- th0br0 12y agoBecause it's slow. Even slower than Scala - esp. on the build side.
- frowaway001 12y agoGroovy and Grails have lost their reason for existence years ago, and without the sponsoring they are both dead.
- monksy 12y agoWhat reason is that? They're an Apache supported project now. http://adtmag.com/articles/2015/03/04/groovy-joins-apache-foundation.aspx http://adtmag.com/articles/2015/03/04/groovy-joins-apache-fo...
- frowaway001 12y ago> What reason is that? Groovy made Java slightly less painful too use, but added its own warts. Today we have languages which are better than Java without adding all of Groovy's mistakes. > They're an Apache supported project now. You mean the place where software projects go to die?
- 12y ago
- ExpiredLink 12y agoPeople interested in 'lightweight' Java EE should check out Adam Bien's web site: http://www.adam-bien.com/roller/abien/ http://www.adam-bien.com/roller/abien/ . He energetically promotes modern lightweight EE (especially for startups). He overshoots the target sometimes (being too simple) but it's always interesting and entertaining.
- StrykerKKD 12y agoI used Jerry at work and it's really one fine HTML parser. I like it better than JSoup, although it works a little bit weirder. :D
- kazagistar 12y ago> Proxetta - the fastest proxy creator with new, unique approach for making pointcuts and different type of advices. Man, this just sounds so lightweight!