r/javahelp • • Apr 12 '24

What can you use Spring for besides building websites?

Title. Can't make video games, can't make desktop GUIs, so what can you do?

0 Upvotes

21 comments sorted by

•

u/AutoModerator Apr 12 '24

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions

  • You include any and all error messages in full

  • You ask clear questions

  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

4

u/XtrZPlayer Apr 12 '24

If you're talking about Spring Boot, you should look for Spring Ecosystem. They got plenty of other projects besides web developing. I expect most of them to be related to RESTful APIs and HTTP protocol. My only experience with Spring was Spring Boot, Spring Security, HATEOAS and just a bit of Spring Cloud & Data flow.

Now, regarding your description, it depends on how you decide to use it. Some games require transactions -> they need a backend to get approved -> that backed can be made with HTTP REST endpoints, from the game by making a request -> check DB fields and so on. This could be just a use case for games. You can make GUIs too, but you'd have to combine it with other frameworks, like Tailwind or React, and even desktop ones if you decide to use JavaFX (idk if it's still used).

I think a healthy way of viewing is that, with a framework like that, you can do anything you'd want to, especially in the back end. Yeah, I am writing a message now in reddit. But most likely when I thit the button Comment, a request for the server will be made, so that it will first be checked if it contains profanity and swear words in it, then it will also check the ocmmunity guidelines, maybe some profile checks to see if I have enough karma to comment and so on. After the request is fulfilled, my comment will appear on the page directly to me, but for the other users, they will need to refresh the page.

1

u/Popular_Aardvark_799 Apr 13 '24

Well... it's designed for making web services. So that's more or less it.

0

u/Chancemelol123 Apr 13 '24

not true, it was designed as an IoC container. The web stuff is an addon that was added afterwards

3

u/Popular_Aardvark_799 Apr 13 '24

no. It was designed as an open source alternative to JaveEE which was designed mostly to implement enterprise web services.

1

u/djavaman Apr 13 '24

APIs and MW layers are a sweet spot. You can to batch processing.

You could probably use Spring to wire up a Swing/GUI app. I don't see why you couldn't do that.

1

u/Chancemelol123 Apr 13 '24

what's a MW layer? And what's batch processing?

3

u/huntsvillian Apr 12 '24

you *can* use spring to make both games (you didn't specify what kind of game) and desktop GUIs..because you can do that in Java.

So the question is more, is spring *ideal* for those use cases? Games, especially graphical games...probably not.

Swing (java ui desktop apps) apps? It might be overkill, but if I needed to make one, I personally would probably start with spring.

1

u/smutje187 Apr 12 '24

Netflix

-4

u/Chancemelol123 Apr 12 '24

pretty sure I said besides websites

4

u/smutje187 Apr 12 '24

Calling Netflix just a Website is like calling Apple just a mobile phone company

-3

u/Chancemelol123 Apr 12 '24

what is Netflix if not a website? 

2

u/TheHazardOfLife Apr 12 '24

There's a lot of underlying systems that are not particularly or necessarily part of the website

-8

u/Chancemelol123 Apr 12 '24

oh stop being obtuse. You know what I was asking

4

u/Leaddore Software Engineer Apr 12 '24

I watch Netflix on my TV, how is that a website? I watch it on my phone with the app, how is that a website?

Spring boot can be used to make micro services easily which can be used to make many things other than websites. I use spring boot at work and I don't make websites, just a lot of API.

1

u/OffbeatDrizzle Apr 13 '24

I mean Netflix on your TV and phone is still just calling some endpoint over the internet. Yes it's not a website, but it's still just calling an API - something that nearly all websites themselves do these days, you're just missing the frontend

2

u/djavaman Apr 13 '24

Its a high performance streaming service. Which I highly doubt is powered by Spring.

1

u/smutje187 Apr 13 '24

The Netflix stack had been published a few times, Java/Spring always played a role in it though.

1

u/XtrZPlayer Apr 12 '24

Streaming sockets

2

u/OffbeatDrizzle Apr 13 '24

Basically any enterprise software can be made exclusively with spring. For example it lets you very easily integrate with databases, message writes etc., so if a company wants to make an application that loads in data, does processing on it and then outputs some result (hint, this is like 99% of enterprise software) then you can use spring to get everything connected, write your own application logic and off you go

1

u/Brutus5000 Apr 16 '24

I'm my project we develop 2 desktop apps with Spring and JavaFX. It's not as simple as a rest api but it is possible.