7 ms·
Spring as a framework has come a long way since the year 2006 when it required multiple XML files for configuration to the now Spring Boot which requires virtua
by royalghost 9y ago
Spring as a framework has come a long way since the year 2006 when it required multiple XML files for configuration to the now Spring Boot which requires virtually zero configuration. Now it is easier to develop MVP web app using Spring Boot than Rails. With the framework such as Angular 2, people withe server side programming experience are finding it easier to develop client side app with much ease. I have found Angular 2 and Spring Boot a great combination for client server app development.
- copperx 9y ago> Now it is easier to develop MVP web app using Spring Boot than Rails. This caught my eye. I have never used a Java framework, but use Rails daily. Does Spring Boot do Rails things such as migrations? Is there a healthy plugin ecosystems? (whatever the Gem equivalent in Java is).
- postcynical 9y agoI used rails professionally since version 0.14. 4 years ago I joined a new company and started developing Java server-side with a few years experience with java from University. After 3 years of building and maintaining a mission-critical Java backend, I would never do it again... We were using a similar framework, called dropwizard, great product, super lean and reliable. If you think Rails is magic, then you haven't seen the Java world, all the magic with annotations, dependency injection, glueing libraries together by placing some files in a folder. If you think Rails 2.3 to 3.0 upgrade was dramatic, then what we went through with a minor update from dropwizard (i think 0.7 to 0.8) was a nightmareish 1-2 months of rewriting half of the code and dependency injection handling. Java is still super verbose, not just the language itself, but also all the libraries that are often over-engineered. Hibernate is quiet easy to get started and you don't understand what all the fuss is about. But once you go start adding features it quickly becomes unmaintainable and any change to the models comes with FUD whether that'll make the queries explode in an unpredictable manner. There's a lot of libraries, but on UI/UX level you don't have anything close to what Rails offers out of the box. Things you take for granted don't exist, like devise. The good parts were: Rails deployments are from the stone-age compared to dropwizards simple approach of installing java and copying the self-running jar (fat binary) to server and start. Very good instrumentation/metrics out of the box with joda-metrics. After 3 years, a pivot required us to rewrite large parts of the logic. We took that as a chance to rewrite/migrate all our services to Elixir/Phoenix. And never looked back. So far Elixir/Phoenix/Ecto to me is the perfect middle ground between a solid Java environment and the speed of development of Rails.
- JanSt 9y agoI tend not to agree with most of your points, but it may be a matter of taste. I actually like Java (but I also see quite some overengineering in some places). > all the magic with annotations ... which are basically just decorators > dependency injection ... which is quite useful for loose-coupling and injecting different implementations (and you don't have to use it) > glueing libraries together by placing some files in a folder .... what? Never done that ;-) > Java is still super verbose, not just the language itself I don't see that. It's actually quite nice for my taste. I guess you don't like generics, but then you have to live without them, which also sucks. > There's a lot of libraries, but on UI/UX level you don't have anything close to what Rails offers out of the box. What do you mean exactly? There are things like thymeleaf if you want SSR, otherwise you can put whatever SPA in front of it. > things you take for granted don't exist, like devise. .. it's not hard to use Spring Security though >Elixir/Phoenix/Ecto" - is there some devise like auth by now? I also like Elixir/Phoenix quite a lot, but it's nowhere near Rails/Springs level.
- pmontra 9y ago> Elixir/Phoenix/Ecto" - is there some devise like auth by now? Coherence https://github.com/smpallen99/coherence https://github.com/smpallen99/coherence
- slow_donkey 9y agoI use dropwizard but I would never consider it (or any java framework) for UI related work. Kinda curious why there was such a big migration conisdering dw is mostly just a combination of packages.
- Joeri 9y agoI haven’t used rails but I did use java’s play framework extensively and found it very easy to use and fast to develop for (coming from a PHP background). It has a migrations system baked into its ORM layer.
- hennsen 9y agoGem is not a „plugin framework“ for rails. It’s a (dependency and) package manager for ruby libraries. That can contain rails plugins too, but i doubt that’s it‘s main use. Most popular languages today have such a thing - cpan gor perl, pip for python, etc. In java there‘s at least maven for that with it’s huge library repositories. There might be more nowadays, i‘ve not been using Java since a good while.
- ivan_gammel 9y agoSpring Boot is an integration framework, which means that it does not implement various things itself, but provides an easy way to take a 3rd party implementation and plug it into your application. In Java there are multiple migration frameworks, including the ones that do migrations in a way similar to Rails. However, this approach is not very popular for exactly the same reasons people writing comments here distrust annotation-based configurations - it's not always obvious what an ORM will do for you. The recommended approach in Spring Boot is to use Flyway library which combines plain SQL migrations with custom Java code for complex data transformations and seeding the db. Regarding ecosystem, the Java one is the biggest and has much more to offer than any other technology. Spring Boot can work with all libraries and there exist Spring Boot plugins for the configuration of the most popular solutions (data storages, clouds, templates, MQs etc). The package management in Java is mature and one of the best and is now replicated/reused on other platforms. E.g. Java-based Nexus repository can be used for hosting libraries for JS and Docker and tools like Apache Maven can build and manage not only Java projects (I think it's even possible to wrap Rails project in Maven).
- vbezhenar 9y agoI guess I'm alone in 2018 year, but I implemented new project with Spring 5 and XML configuration which works just fine and I think that it's easier to understand and support than Java configuration (or autowiring which I never use, because explicit is better than implicit even at the cost of boilerplate).
- beepbeepbeep1 9y agoNo. I completly agree with, it's far easier than debugging what configuration has been applied due to specfic annotations used.
- ssijak 9y agoYou can use Java explicit configurations without Spring boot magic. Using XML to configure an app is so backward to me and prone to error, not to mention debugging. When I see xml config file in 2018 I want to poke my eye out.
- cztomsik 9y agoI don't like XML either but I can clearly see the point in being explicit. Unless you're working alone or unless everybody knows exactly how the whole system works, being explicit will save you a lot of time. If you're still insisting, I suggest you to clone random mid-size spring project from github and do some non-trivial change (like implement automatic tracking of all changes or soft-deletes)
- jacques_chester 9y ago> explicit is better than implicit You may be interested in programmatic / functional bean registration[0], which was introduced in Spring Framework 5. It has a particular focus on Kotlin support[1][2]. [0] https://springoneplatform.io/sessions/programmatic-bean-registration-with-spring-framework-5 https://springoneplatform.io/sessions/programmatic-bean-regi... [1] https://spring.io/blog/2017/08/01/spring-framework-5-kotlin-apis-the-functional-way https://spring.io/blog/2017/08/01/spring-framework-5-kotlin-... [2] http://ilities.co/2017/09/10/annotation-free-spring/ http://ilities.co/2017/09/10/annotation-free-spring/
- TheRealDunkirk 9y ago> Now it is easier to develop MVP web app using Spring Boot than Rails. BWAHAHAHAHAHA! Good one. Seriously, though, I'm really, really glad to see this come up this morning. I've done a lot of .NET lately, but Rails has been my main tool for 10 years. However, because it's (apparently) a strange, new, unproven-and-potentially-exceedingly-insecure framework, and because I'm the ONLY PERSON in a company of SIXTY THOUSAND employees who could possibly write a program with it, I've been forced to stop using it. I took FOUR MONTHS of arguing about it with the powers-that-be to conclude that I should use Java instead. I have 3 web applications to write, right now, with some flavor of Java EE. For a couple of weeks, I've been trying to bootstrap an environment to read an existing database I had already created with Rails, and filled with production data. I thought it would have been straightforward. I'm trying to use current versions: * Netbeans 8.2 * Java 1.8 * Gradle 4.6 * SpringMVC 5.0.4 * Hibernate 5.2.15 I can't find a single, working example that demonstrates this stack. Not a single one, on the entirety of the internet! Every example I can find switches out some part of that stack, and makes the flow different. Netbeans and Eclipse do things differently, and both have about 3 different ways to generate a Java web application. Then there's the whole Maven thing. I guess most of the world hasn't really switched to Gradle, despite their site's glowing description of the advantages? And what is "Spring Framework?" There's really several different pieces of that puzzle, and that's fine, but, at the end of the day, show me the code, AND TELL ME WHERE TO PUT IT IN THE FILE STRUCTURE TO MAKE IT WORK. Most of the examples I can find about how to write a Java web application never even get to the point of pulling data from a database, and so finding an example that uses either Hibernate OR JPA is almost non-existent. This just makes me shake my head. My current direction, which I was all set to get serious with today, was to use Groovy on Grails, under IntelliJ IDEA. After a couple of weeks of experimentation, it's the only stack I've been able to bootstrap, and actually get a listing of objects from the database. I feel it probably takes too many liberties to simplify the workflow, and will quickly lead to a bottleneck I don't know how to get out of, but, dammit, it's the only thing I can find some reasonable examples for. (But even IDEA wants to generate a stack based on the non-current Spring 4.3.14, and Hibernate 5.1.5. Spring 5 is released. Why doesn't IDEA "support" it yet? What little examples I can find show that a lot of things are changing from Spring 4 to 5.) Through this learning process, I've realized just how much tribal knowledge I've absorbed about Rails. I "grew up" with Rails. I was playing with it in the 0.x days, got serious with it in the early 2.x era, and have stayed with it ever since. I understood that learning how to use another web stack would be a challenge. While the actual language is hardly a concern to me, I had no idea that the chaos of choices and versions would complicate the process of just trying to get started. At the very least, when you say "Rails X.0", you've described all the major pieces of the stack, and the IDE is immaterial. That is simply not the case in the Java world. So I've said all of this to set the context in order to ask you this: What is the "right" framework stack to use to create a Java web application TODAY? And by "right," I mean "most popular," in order to make finding answers as easy as possible. For the sake of argument, the 3 apps I need to write are essentially simple CRUD applications, so there are no esoteric requirements to consider. What's the most straightforward and maintainable approach, and where's the definitive documentation on how to configure it? I'm ready to go all-in on SOMETHING, but I'm overwhelmed with choices and a lack of examples.
- edem 9y agoTrue and true. Even better is that you have native Kotlin support for it and with the advent of Kotlin multiplatform projects now I can write apps using Kotlin only. I finally reached a point that I don't have to use Javascript anymore!
- zerr 9y agoWhy Angular 2 and not 5?
- blktiger 9y agoBecause how else do you differentiate between Angular 2+ and Angular 1? They really should have changed the name since they are two completely different frameworks.
- iovrthoughtthis 9y ago> Now it is easier to develop MVP web app using Spring Boot than Rails. Really? Does it do a lot of code generation across the db / server / front end? That plus convention over configuration makes most of my rails development pretty fast.