Need advice about which tool to choose?Ask the StackShare community!

guava

2.2K
192
+ 1
6
Spring

3.9K
4.7K
+ 1
1.1K
Add tool

Spring vs guava: What are the differences?

# Introduction
When considering software development in Java, two popular libraries that often come into conversation are Spring and Guava. While both provide useful utilities and functionalities, they serve different purposes in the Java ecosystem.

## 1. **Dependency Injection**:
Spring is commonly used for its robust dependency injection framework, allowing developers to easily manage dependencies and facilitate the creation of loosely coupled components. On the other hand, Guava does not focus on dependency injection as a primary feature, but rather provides various utilities for common programming tasks.

## 2. **Collection Utilities**:
Guava offers a rich set of utilities for working with collections, including immutable collections, additional collection types, and powerful filtering methods. In contrast, Spring's primary focus is not on collection manipulation, and it typically leverages Java's core collection APIs for such tasks.

## 3. **Concurrency**:
Guava provides helpful utilities for concurrent programming, such as ListenableFuture and various concurrency primitives. In comparison, while Spring offers support for managing concurrency using features like @Async, its primary focus is on providing enterprise application development tools.

## 4. **Functional Programming**:
Guava includes support for functional programming paradigms through its Function and Predicate interfaces, enabling developers to write more expressive and concise code. Spring, while not opposed to functional programming, does not emphasize it as heavily as Guava.

## 5. **Error Handling**:
Spring offers a wide range of error handling and exception management mechanisms, including declarative transaction management and robust support for AOP-based error handling. Guava, while providing utilities for common error handling tasks, does not have the same level of sophistication in this area as Spring.

## 6. **Community and Support**:
Spring has a large and active community, which contributes to its vast ecosystem of libraries, tools, and resources. Guava, while widely used and respected, may not have the same level of community support and resources as Spring.

In Summary, Spring and Guava differ in their primary focus areas, with Spring excelling in enterprise application development tools, dependency injection, and error handling, while Guava shines in collection utilities, concurrency, functional programming, and community support.
Advice on guava and Spring
Needs advice
on
DjangoDjango
and
SpringSpring

I am a graduate student working as a software engineer in a company. For my personal development, I want to learn web development. I have some experience in Springboot while I was in university. So I want to continue with spring-boot, but I heard about Django. I'm reaching out to the experts here to help me choose a future proof framework. Django or Spring Boot?

Thanks in Advance

See more
Replies (5)
Recommends
on
SpringSpring

Kamrul Hasan, Don't choose dying technologies with small communities. How many startups do you think use Spring and Django? Use Google Trends to compare technologies. Study the StackOverflow developer survey and job websites to see what technologies are wanted. Few teams can afford to train you to get up to their level so be a life-long learner. Embrace the dawn of a new industry and become an expert.

See more
Sulaiman Sanusi
Recommends
on
SpringSpring

I recommend you stick to Java Spring as you already have experience with the technology, i suggest you master this technology and then if Django seam to be very interesting to you, django is a framework you can easily pickup as python is also easy, you have to probably be able to manage the context switching between a static typed language like Java to dynamic language like python

See more
Christoph Becker
Recommends
on
DjangoDjangoSpringSpring

It depends on what you want. Spring is Java-based whereas Django is Python-based. The question rather is Java vs Python. I personally recommend Python as it's shorter and easy to learn. But Java has advantages in really big systems.

See more
Gonzalo Fernández
Recommends

Hi Kamrul,

It really depends on the kind of project and whether you feel more comfortable with Java or Python. Both are excellent frameworks, with a huge community and learning material. I've been working with Spring Boot since I started coding almost and I can assure you it's the perfect combination for Java. The learning curve may be harder that Django, but once you know the basics you're good to go. I can't tell you much about Django but you must now by now that it has a great reputation with Python users. In any case I don't think you can go wrong with any of these two. My advice is, if you are already familiar with the Spring framework, give Spring Boot a try, because you're going to find out that it just makes the whole Spring experience so much easier. Let us know what you chose!

See more
Recommends
on
DjangoDjango

Both are in active development and had huge community support. It really depends on you what you are comfortable with. Both are married to their respective languages. I choose Python over Java because of its simplicity and readability. To develop in java you need to write a lot of code. That's how java is. The best part I love with Django is its synchronization with Databases.

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of guava
Pros of Spring
  • 5
    Interface Driven API
  • 1
    Easy to setup
  • 230
    Java
  • 157
    Open source
  • 136
    Great community
  • 123
    Very powerful
  • 114
    Enterprise
  • 64
    Lot of great subprojects
  • 60
    Easy setup
  • 44
    Convention , configuration, done
  • 40
    Standard
  • 31
    Love the logic
  • 13
    Good documentation
  • 11
    Dependency injection
  • 11
    Stability
  • 9
    MVC
  • 6
    Easy
  • 3
    Makes the hard stuff fun & the easy stuff automatic
  • 3
    Strong typing
  • 2
    Code maintenance
  • 2
    Best practices
  • 2
    Maven
  • 2
    Great Desgin
  • 2
    Easy Integration with Spring Security
  • 2
    Integrations with most other Java frameworks
  • 1
    Java has more support and more libraries
  • 1
    Supports vast databases
  • 1
    Large ecosystem with seamless integration
  • 1
    OracleDb integration
  • 1
    Live project

Sign up to add or upvote prosMake informed product decisions

Cons of guava
Cons of Spring
    Be the first to leave a con
    • 15
      Draws you into its own ecosystem and bloat
    • 3
      Verbose configuration
    • 3
      Poor documentation
    • 3
      Java
    • 2
      Java is more verbose language in compare to python

    Sign up to add or upvote consMake informed product decisions

    What is guava?

    The Guava project contains several of Google's core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth.

    What is Spring?

    A key element of Spring is infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise applications so that teams can focus on application-level business logic, without unnecessary ties to specific deployment environments.

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use guava?
    What companies use Spring?
    See which teams inside your own company are using guava or Spring.
    Sign up for StackShare EnterpriseLearn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with guava?
    What tools integrate with Spring?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    What are some alternatives to guava and Spring?
    Java 8
    It is a revolutionary release of the world’s no 1 development platform. It includes a huge upgrade to the Java programming model and a coordinated evolution of the JVM, Java language, and libraries. Java 8 includes features for productivity, ease of use, improved polyglot programming, security and improved performance.
    RxJava
    A library for composing asynchronous and event-based programs by using observable sequences for the Java VM.
    Quarkus
    It tailors your application for GraalVM and HotSpot. Amazingly fast boot time, incredibly low RSS memory (not just heap size!) offering near instant scale up and high density memory utilization in container orchestration platforms like Kubernetes. We use a technique we call compile time boot.
    Apache FreeMarker
    It is a "template engine"; a generic tool to generate text output (anything from HTML to auto generated source code) based on templates. It's a Java package, a class library for Java programmers.
    Jackson
    It is a suite of data-processing tools for Java (and the JVM platform), including the flagship streaming JSON parser / generator library, matching data-binding library (POJOs to and from JSON) and additional data format modules to process data encoded in Avro, BSON, CBOR, CSV, Smile, (Java) Properties, Protobuf, XML or YAML; and even the large set of data format modules to support data types of widely used data types such as Guava, Joda.
    See all alternatives