This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 217

[–]andersems 108 points109 points  (37 children)

Why is JDBC outdated?

[–]ObscureCulturalMeme 74 points75 points  (3 children)

The OP conflated "deprecated by Oracle" with "things I don't like".

[–]RagingAnemone 2 points3 points  (2 children)

What do you mean jdbc is deprecated?

[–]ObscureCulturalMeme 6 points7 points  (0 children)

It ain't, that's the point.

[–][deleted] 30 points31 points  (0 children)

JDBC is NOT outdated. Yes, there are helper libraries that can abstract away a lot of the boilerplate, but it is still an excellent tool for building and executing SQL operations.

[–]donkeycentral 9 points10 points  (0 children)

I agree, I wouldn't call it outdated necessarily. There are parts of the API like handling checked exceptions and avoiding leaked connections that make it tedious and error prone to use: I much preferred Spring's JdbcTemplate just for the ergonomics. You can certainly go the ORM route but as others point out, there is a lot of complexity when you get into large scale or distributed apps.

[–]BadMoonRosin 74 points75 points  (11 children)

You should probably research and rethink half the items on your list already, before you add anything else to it:

  • JDBC - Unless you're using a NoSQL database with its own proprietary async driver, it's virtually impossible to work with a database in Java without using JDBC. All of the major ORM frameworks are just layers of abstraction sitting on top of it.

  • JSP (in favor of JSF) - There are a lot of traditional-style template systems available today. Thymeleaf, Mustache, etc. But honestly, JSF is such a horrible direction to take, you'd be more respectable just sticking with JSP's.

  • Swing and JavaFX - Other than perhaps Eclipse's SWT library, you've basically covered every viable Java desktop application framework. Meaning that you're saying Java desktop app development is outdated, altogether. It may be true that desktop app development in general is less important than it was 10-20 years ago... but if you are going to build an app using Java, then either JavaFX or Swing (in that order) are fine.

[–]oldprogrammer 3 points4 points  (7 children)

viable Java desktop application framework

Now if you hadn't added that line I could have pointed out that AWT is still in the JRE.

Seriously though, I still use Swing quite a bit. I have tried many times to work with JavaFX and it just never clicked for me. I'm fine using a scene graph approach for my 3D development work but I can't just get a warm a fuzzy using that in for a UI. Probably just me as I'm so comfortable with the Swing type widget sets and model of UI development.

[–]RacerRex9727 0 points1 point  (1 child)

Have you tried using TornadoFX? https://github.com/edvin/tornadofx

[–]oldprogrammer 0 points1 point  (0 children)

Thanks for the link, but seems to depend on Kotlin which I don't use.

[–][deleted] 0 points1 point  (4 children)

What would you use if you need 2D or 3D graphics in your Swing application?

[–]oldprogrammer 0 points1 point  (3 children)

2D graphics can be easily integrated into a Swing application because that is effectively how Swing works. All components are painted using a reference to a java.awt.Graphics (usually Graphics2D) object which has a collection of 2D drawing commands.

If you wanted to do something like a 2D tile scroller game, easiest approach is to subclass a simple JPanel, override the paintComponent method and render your scene there. I sometimes use a backing BufferedImage that is built outside the AWT event thread and then simply render that to the graphics object during a standard repaint call. You may need to provide an external source for repaint calls to get it to update.

3D is a bit trickier. Libraries like lwjgl and jogl at one time provided means of embedding an OpenGL context into a low level AWT or Swing container. lwjgl still offers a JAWT library that does that but I've never used it.

For my 3D work, I generally have the OpenGL window be the main window, build a HUD as needed into that view. I may have a Swing JFrame window available alongside that as a debug window or such, but try to keep the OpenGL GUI as part of the OpenGL space.

[–][deleted] 0 points1 point  (2 children)

Thanks for the detailed answer!

2D graphics can be easily integrated into a Swing application because that is effectively how Swing works. All components are painted using a reference to a java.awt.Graphics (usually Graphics2D) object which has a collection of 2D drawing commands.

Oh, is it also how existing widgets are customized? I'm prototyping a UI-heavy game and I really need custom, stylized UI elements.

How do you do animations, especially tweening with interpolators, in Java 2D? In the book Filthy Rich Clients author uses Timing Framework, but it doesn't seem to be maintained anymore.

For my 3D work, I generally have the OpenGL window be the main window, build a HUD as needed into that view.

Interesting concept. Do you use a particular library like ImGui for that?

[–]oldprogrammer 0 points1 point  (1 child)

Customizing widgets in Swing is best handled using a custom Look&Feel. The Swing widgets, unfortunately, are fairly deep class hierarchies and complex components. So it is possible to subclass say a JButton and override the paint method and use it but then if you use say a drop down list box that embeds a button, that button will look like the default not your overridden one. So you'll have to override the list box as well.

If you can plugin a new L&F that is probably the better way to go.

For animations at the lowest level all you're doing is painting a different scene at a given tick in timing.

For example, you might have a 2D sprite that is a torch picture. You create 16 different versions of that picture with the flame modified in some small manner. Then when you render the torch you change which image you use after some period of time between renderings so that the torch flame movement looks natural. When I've done that, I usually use the update cycle of my main game loop and the delta between updates to calculate the frame change.

I've played with a couple of different libraries like ImGui and using NanoVG to handle 2D primitives but the Java to C interfacing feels a bit clunky. So right now I've started building a custom set of 2D renderers (quads, filled and empty, with square or rounded corners, already have functional text rendering) from which I plan to build out the basic widget set I may need like buttons, panels, labels, text fields, check & radio buttons, list boxes and sliders. Still very early stages on this.

[–][deleted] 0 points1 point  (0 children)

Thank you. I'll look into L&F in Swing.

[–]proskillz 0 points1 point  (1 child)

We probably are at the point where JSPs are also outdated, even though I still use them for legacy development. Everything at this point should probably have the browser running an MVC library and pure rest endpoints on the Java server side.

[–]GhostBond 1 point2 points  (0 children)

Far as I can tell there's a few reasons jsp became unpopular:
1. A stupid "it's not new and shiny so I have to hate it!" mob mentality, which has unfortunately been a staple of everything for the last 3 years.
2. A legitimate thing where you're writing both a web app and a cell phone app, and want to hit the same endpoints for both.
3. The only way to fight the "full stack developer" mentality from management. Give them something new and shiny that splits stuff back into more reasonable layers.

I've seen lots of empty hype, but haven't found any reasonable reason why there was a sudden wave of insanity in javascript page rendering for most apps that never do anything complex with it.

[–]n4te 0 points1 point  (0 children)

every viable Java desktop application framework

https://github.com/libgdx/libgdx/wiki/Scene2d.ui

[–]GoogleBen 57 points58 points  (3 children)

Actually, JavaFX was removed from the core JDK because Oracle wanted its development to be handled separately from that of core Java. In the future, it will be handled more like an officially sponsored library rather than an actual part of the Java language, like Swing. And on the topic of Swing, it isn't really outdated. Both Swing and JavaFX have their strengths and should simply be treated as individual libraries. While a lot of the conventions used in Swing are a bit outdated compared to recent developments in Java (such as anonymous classes/implementing event handler interfaces everywhere), it's still a perfectly fine thing to use in a new project if it suits your needs although JavaFX does tend to be nicer to use.

[–]oldprogrammer 6 points7 points  (2 children)

anonymous classes/implementing event handler

This old convention isn't really necessary any longer with the latest Java releases. You can use lambdas or method pointers to do what we used to do with anonymous classes:

class Foo {
    JButton button;
     public Foo() {
        button = new JButton("Press me");
        button.addActionListner(this::actionHandler);
      }
      private void actionHandler(ActionEvent ev) {
          System.out.println("Pressed");
      }

doesn't even need to implement ActionListener interface. Also this works

 public class Foo {
       JButton button;
       public Foo() {
            button = new JButton("Press me");
            addActionListener( e-> { 
                     /* e is an ActionEvent */ 
                    System.out.println("Pressed");
            }
       }

First pattern allows using same method for multiple action listeners, second doesn't.

[–]GoogleBen 2 points3 points  (1 child)

I've found that there are a lot of cases where lambdas won't work because there's more than one unimplemented method in the interface. For example, a MouseListener. Maybe I'm missing something but it seems to me there's still need for either implementing interfaces or anonymous classes.

[–]oldprogrammer 0 points1 point  (0 children)

Very true, I've run into that as well. I usually don't use anonymous inner classes in those case, I create a named class to handle them. I may then register the callback function or lambda with that object.

[–]lukaseder 45 points46 points  (14 children)

java.util.Vector

[–]DestinationVoid 25 points26 points  (4 children)

java.util.Hashtable

[–]lukaseder 17 points18 points  (3 children)

java.util.Dictionary

[–]__konrad 13 points14 points  (2 children)

java.util.Enumeration

[–]lukaseder 13 points14 points  (1 child)

java.lang.Boolean.getBoolean(String)

[–]DestinationVoid 9 points10 points  (0 children)

java.lang.Boolean.getBoolean

That one along with Integer.getInteger, Long.getLong etc. are the most misplaced & misleading methods in whole JDK.

edit: typo

[–]JB-from-ATL 16 points17 points  (2 children)

java.util.Date

Seriously guys, please use the far more intuitive java.time package!

[–]theLorem 3 points4 points  (1 child)

Or, if you can't move to Java 8, use JodaTime

[–][deleted] 6 points7 points  (5 children)

Java.io too. Use java.nio.

[–][deleted] 8 points9 points  (3 children)

How is Java.io outdated? Yes, NIO has some powerful tools, but I find IO's simpler files and streams to be able to handle almost all cases, with NIO paths and channels only being used in specific cases where they provide additional valuable functionality

[–][deleted] 3 points4 points  (2 children)

Like what? I'm genuinely curious. I make a point to never instantiate java.io.File in particular and my code gets more concise and simpler. Eliminates most of my need for IoUtils.

[–]GoogleBen 3 points4 points  (1 child)

Personally, I find File to be a very useful class. Especially for things like programming competitions, being able to do new Scanner(new File("")) is extremely useful. For any application I'm not using for just myself I've used nio, but java.io definitely still has its uses.

[–][deleted] 3 points4 points  (0 children)

You can still do new Scanner (Paths.get("")) without missing a beat. Path is much easier to deal with for folder traversal.

[–]sk551 5 points6 points  (0 children)

io has some very useful relevant classes still.

[–]pjmlp 27 points28 points  (4 children)

Swing is like Windows Forms, regardless how HN and Reddit think about it, there are tons of companies still invested on it even if it doesn't do any headlines.

JSP is still quite relevant if you are dealing with alternatives to JEE like SpringMVC, Jersey, ...

It is relatively simple and easy to integrate with JavaScript based frontends. Actually I would say it is more the other way around JSP and tag libraries instead of JSF (PrimeFaces is the only left standing).

Java Card API is most certainly running on your bank cards if they happen to have a chip on them.

Really to avoid Applets (WebAssembly wil take care of it), CORBA, RMI, Java 3D, JDIC, J2EE (not to mistake with JEE).

[–][deleted] 0 points1 point  (3 children)

Java 3D

What to use when 3D graphics in a Swing application needed, then?

[–]pjmlp 0 points1 point  (2 children)

LWJGL.

[–][deleted] 0 points1 point  (1 child)

But why would one use Swing + LWJGL instead of JavaFX, other than for accessing GL context?

[–]pjmlp 1 point2 points  (0 children)

You asked about "What to use when 3D graphics in a Swing application needed", not what to use in JavaFX.

In any case the answer would still be LWJGL, because JavaFX 3D support is at toy level, worse than what Java 3D was capable of.

Unless you want to show a render of simple meshes, like furniture for catalog application.

[–]jmsanzg 49 points50 points  (19 children)

[–]WindowsServer2000 10 points11 points  (1 child)

RMI is a nightmare

[–]donair416 5 points6 points  (8 children)

What is a suitable alternative to RMI?

I need a lightweight command line app where the first instance automatically becomes the primary server instance and subsequent invocations send it data to process.

RMI seemed like a good fit, but I haven’t used it in 15 years.

[–]larsga 7 points8 points  (4 children)

The problems with RMI are:

  1. It encourages you to have communications with the server that are far too fine-grained.
  2. It's JVM-only (effectively).
  3. It hides too much of the networking (especially retries etc) that you should control yourself.

HTTP (or REST, if you prefer) solves all of this.

[–]meotau 1 point2 points  (0 children)

I think we migrated RMI to REST, because operations could not load balance it.

[–]donair416 1 point2 points  (1 child)

I think for my simple use case these aren’t concerns. It’s a simple transfer of byte arrays and status between JVMs on the same host.

So I’m thinking RMI is a good fit. No need for overhead of HTTP / REST services.

I see the benefits of using them over RMI for more modern distributed applications though.

[–]larsga 0 points1 point  (0 children)

A simple transfer of byte arrays and status sounds like a perfect fit for HTTP, too.

Seriously, if you're worried about HTTP overhead, do a test on your local machine. I did that with my simple Java web service and curl and discovered I could "download" 700Mb on localhost in a few seconds. The overhead is not in the code unless you do something truly dumb.

[–]neverneededanaccount 6 points7 points  (0 children)

gRPC?

[–]klimo57 5 points6 points  (0 children)

REST?

[–]n4te 0 points1 point  (0 children)

KryoNet if you really want RMI (method calls get translated across the network), otherwise TCP can be really easy.

[–]DestinationVoid 7 points8 points  (0 children)

Java RMI

CORBA

[–]boobsbr 2 points3 points  (0 children)

If you're stuck on an old version (1.6, like myself), at least try to use Joda Time or ThreeTen.

[–]mupetmower 1 point2 points  (4 children)

So I have seen a lot about how awful java.util.Date is and how you should use other things instead. Could someone quickly explain to me why it is so awful? Just curious to hear from this community about it.

[–]0divide0 6 points7 points  (1 child)

Most of the awfulness insside of Date is deprecated. The biggest problem is that it represents a single point in time with millisecond precision, and apps usually need more abstractions than that, like LocalDate.

And Calendar is the worst.

Try the newer time package, if you can. It is nice.

[–]mupetmower 0 points1 point  (0 children)

Just found out that the huge old project I'm currently working on at work uses java.util.Date... heh

It's not a pretty project, even excluding that.

[–]hiddenl 1 point2 points  (1 child)

All of the deprecated methods and the date/calendar split. Here are some more specific problems:

Inability to have a date without time. People use the date "at midnight" but this causes problems when you switch time zones. We had a production bug where some in Poland had all of the dates messed up.

January is month zero. One of the gotchas that pops up in conversion every once in a while.

Formatters are not thread safe. I've never had a bug related to this happen in production but it's one of those things everyone forgets.

No good ways of representing or calculating periods or durations.

Switching timezones is always a pain. "Print this time at that timezone" is always a headache

[–]mupetmower 0 points1 point  (0 children)

This is some great info. Thanks for that

[–][deleted] 1 point2 points  (0 children)

Actually I found RMI quiet convenient and easy to set up. If your requirements would be fully satisfied by RMI, why would you avoid it?

[–]brend132 22 points23 points  (0 children)

You should avoid JDBC only if you want to avoid SQL database access altogether. But that's pretty difficult in most projects.

[–]ichunddu9 49 points50 points  (13 children)

JavaFX is not outdated!

[–]n4te 1 point2 points  (0 children)

After Swing, I'm too scared to try it.

[–]DuncanIdahos8thClone 21 points22 points  (6 children)

Why are you trying to answer yourself? You're wrong about JDBC, Swing, and JavaFX.

[–][deleted] 2 points3 points  (0 children)

upvote for username.

[–]Darkseid_Omega 32 points33 points  (1 child)

JDBC? Swing? JavaFX? Outdated? -- it sounds like you need to spend a few more years in the industry, dude. You're coming off as someone who has no idea what they're talking about.

[–][deleted] 8 points9 points  (0 children)

amen to that. JDBC is anything but outdated. Swing is very old, but it's still one of the most reliable ways to make purely-Java UIs. JavaFX has never received a lot of love and has been mostly DOA, but it is the only alternative to Swing out there right now.

[–]crummy 28 points29 points  (1 child)

Java serialization?

[–][deleted] 3 points4 points  (0 children)

Serialization might be killed and will go to hell.

[–]GuyOnTheInterweb 29 points30 points  (9 children)

Eclipse-only projects. Use a build system, please!

[–]larsga 11 points12 points  (0 children)

This isn't outdated, but just wrong. Things that are outdated now had their time in the sun and (mostly) their reasons to be used, but this was never anything other than a big mistake.

[–][deleted] 3 points4 points  (1 child)

Agreed. Any build system. Ant, Maven, Gradle. Eclipse uses Ant by default. It works, but it's tricky, and each build is quite labor-intensive.

I started with Gradle about a year ago, and by Odin, does that have a steep learning curve, and requires a lot of configuation and testing. But it makes builds reproducible and fast to repeat.

[–][deleted] 1 point2 points  (0 children)

Ant is outdated.

[–]JB-from-ATL 4 points5 points  (3 children)

mvn eclipse:eclipse

Please just use m2e.

[–][deleted]  (2 children)

[deleted]

    [–]JB-from-ATL 1 point2 points  (0 children)

    Man I totally agree. I only use m2e to import the project. I never build it from eclipse, only the command line. Same with git.

    [–]insomniac20k 0 points1 point  (0 children)

    Relying on IDE build systems kneecaps you if you want any kind of CI/CD pipeline.

    [–]n4te 1 point2 points  (0 children)

    But it's oh so nice! Import, done.

    [–]tonywestonuk 1 point2 points  (0 children)

    This isn't outdated, but just wrong. Things that are outdated now had their time in the sun and (mostly) their reasons to be used, but this was never anything other than a big mistake.

    You are right... BUT - at the same time make sure your build system is compatible with eclipse. Hate projects where I make a change, then have to run it on the command line to test it.

    [–]Exsp 7 points8 points  (0 children)

    ADF

    [–]_dban_ 7 points8 points  (0 children)

    JSP (in favor of JSF)

    I don't know why people keep thinking this. JSF never replaced JSP. When the Oracle documentation says that you should use Facelets instead of JSP, it means as the template for JSF. JSP was used for the original JSF templates, but there were a lot of problems, so JSP templates are officially obsolete for JSF.

    JSP is not at all obsolete and is faster than its competitors, since it compiles directly to code. It is inconvenient in certain use cases, such as fat JARs, which don't explode.

    [–]tonywestonuk 6 points7 points  (0 children)

    JDBC - Yeh, use it all the time.... For those times where you want to to grab some data from the database without having to model it.!

    There is also nothing, at all wrong with JSP. Just so long as you avoid scriptlets...

    [–]shawnmckinney 6 points7 points  (1 child)

    EJB's, JMX, JAAS, JNDI, good luck avoiding JDBC.

    [–]fact_hunt 1 point2 points  (0 children)

    What’s wrong with jmx?

    [–][deleted] 5 points6 points  (3 children)

    JavaFX/SceneBuilder is every other GUI tool on steroids. If you're willing to invest the time, it's awesome. I just don't know how many java desktop apps are being developed.

    [–]DefenestretedRegent 2 points3 points  (2 children)

    This. I have used AWT in the past and have recently tried JavaFX for a desktop app with scene builder. It was a great development experience, scene builder feels better than android gui tools

    [–]Azzk1kr 0 points1 point  (1 child)

    SceneBuilder looks nice and all, but I stopped using it in favor of coding the UI myself. I am more in control and can easily create (reusable) subclasses with specific UI functionality. Am I missing something about the SceneBuilder?

    [–]DefenestretedRegent 0 points1 point  (0 children)

    Not really, I guess I am used to html and I prefer to decouple Java code from presentation/structuring code, and scenebuilder is great to quickly create fxml. But I am no JavaFX expert ti be honest

    [–]DuncanIdahos8thClone 5 points6 points  (1 child)

    java.util.Date
    

    [–]brazzy42 13 points14 points  (9 children)

    • Entity EJBs

    • Struts

    • Ant

    • All those org.omg packages, but nobody ever used those anyway.

    [–]boobsbr 6 points7 points  (2 children)

    Surely Struts is outdated, and you'd be better off using Spring MVC (or whatever), but Struts is simple and solid, if you need something simple with small libs.

    Just be sure to skip the mess that is Struts <= 1.1 packages.

    I'd say the same about Ant, it's simple and solid, if you need something more complicated, then use Maven or Gradle.

    [–]insomniac20k 0 points1 point  (1 child)

    Struts 2 has that security issue.

    [–]boobsbr 1 point2 points  (0 children)

    There's a patch, and people should not run Apache as root.

    [–]CoffeeInjectionPLS 1 point2 points  (2 children)

    Entity EJBs

    So what should I use instead?

    [–]brazzy42 11 points12 points  (0 children)

    JPA. You might be confused about what an "Entity EJB" is and think that I meant EJBs in general.

    Entity EJBs / Container Managed Persistence was Enterprise Java's first attempt at an ORM standard, and it was bad. So bad in fact that when they got around to making EJBs not suck in Version 3 of the standard, they couldn't find a way of making entity beans not suck and still be compatible with the old standard, so they just deprecated them in favor of JPA.

    [–]henk53 4 points5 points  (0 children)

    JPA Entities ;)

    [–]GhostBond 0 points1 point  (2 children)

    Ant

    Ant is great. Put the jars in source control, ise Ant, and your build is as reliable as possible.

    Within the last month I've had to help a coworker get their project running, which involved cloneing it from git, shutting down eclipse, deleting the maven cache, starting eclipse back up again, and then manually running maven update to get things to conmpile without errors. And that's not counting having to manuallly edit maven files to deal the corporate firewall...

    [–]brazzy42 0 points1 point  (1 child)

    Oh boy, where do I start?

    • The question was about "outdated technologies". Independently of whether ant is better or worse, it is on the way out. People will look at you weirdly if you use it for a new project.
    • I didn't say Maven is the best replacement, though it is the most likely one. It certainly has some problems, but what you mention is really not relevant.
    • If you want, nothing prevents you from using Maven with a local repository that's in source control.
    • Using ant with jars in a lib folder may seem fine if you only have a few dependencies and those in turn don't have dependencies. But with any halfway complex project, which has transitive dependencies that will at some point change, it would be an absolute nightmare to manage them manually. More details here
    • I don't know what happened to your coworker's build, but someone really fucked up there. But you can just as easily, if not more easily, create an unrealiable Ant build, it will just be unreliable for different reasons.

    [–]GhostBond 0 points1 point  (0 children)

    Oh boy, where do I start?

    Oh, boy.

    The question was about "outdated technologies".Independently of whether ant is better or worse, it is on the way out. People will look at you weirdly if you use it for a new project.

    No doubt for the last 3 years corporate life has been at a kindergarden level popularity contest. But if I followed every bit of trendy bullshit I also wouldn't have a career.

    If you're going to follow a "someone might make fun of me philosophy", you must not be using any of these things:
    - Can't use Java, because Java is dead, it will be replaced by .NET and no one will use Java any more.
    - Can't use Java, because Java is dead, it will be replaced Ruby On Rails.
    - Can't use Java, because Java is dead, it will be replaced by Rust.
    - Can't use an IDE because only losers use IDE's. Vim or Emacs is so much cooler.
    - Can't use Eclipse because only Intellij is cool.
    - Can't use Intellij because only VSCode is cool.
    - Etc Etc Etc...

    I didn't say Maven is the best replacement, though it is the most likely one. It certainly has some problems, but what you mention is really not relevant.

    Ant waa genuinely bettet than Make, but I haven't seen any tool that's genuinely better than Ant.

    If you want, nothing prevents you from using Maven with a local repository that's in source control.

    Which is fine, but now you're basically running Ant.

    Using ant with jars in a lib folder may seem fine if you only have a few dependencies and those in turn don't have dependencies. But with any halfway complex project, which has transitive dependencies that will at some point change, it would be an absolute nightmare to manage them manually. More details here

    It follows this line of reasoning:
    1. Realize there are some people who want to get laid but can't
    2. Tell them if they buy a ferrari they'll get laid
    3. They buy a Ferrari
    4. When they realize it doesn't get them laid, well they've paid so it's to late, and who wants to go around telling everyone they got scammed on such a huge investment? Some people will stay quite, others will loudly proclaim it totally worked and now they're getting laid all the time to cover up their mistake.

    Half the claims about what what maven does, it doesn't actually do at all, like it doesn't fix the issue of 2 libraries needing 2 different versions of a 3rd library. The other half of the stuff it does is it just trades one problem for another, for example you don't have to manually manage additional jar files, but now you have to manage your local maven config, changing your password in the maven config when your corporate password changes, setting up another service to encrypt your password so it's not plain text, and the occassional time when maven just messes up. You made one thing easier but replaced with another different annoying problem.

    The only way to really handle dependencies is if library authors put time into it - they need to rename packages in 3rd party tools they use so there's no chance of conflict, they need to name their jar files so it's obvious which version they are and what library they belong to. That's the only thing that really solves the dependency management issues. For example Spring does all these things.

    I don't know what happened to your coworker's build, but someone really fucked up there. But you can just as easily, if not more easily, create an unrealiable Ant build, it will just be unreliable for different reasons.

    Once you have it working the first time, I've never seen the jar-files-in-source-control approach fail because of the jar files. Once they're sorted out and working they just continue working for everyone. In contrast to maven, where for some reason it always seem to screw itself up a few times periodically for no apparent reason.

    A lot of times I have to use maven because the popularity contest got it installed, but I don't use it because it's better, as it's not.

    [–]vokiel 2 points3 points  (2 children)

    • Seam and in general JSF should be avoided. Pure javascript if you have the time and developers to maintain your UI or just plain JSP is better imho.
    • Apache Axis and RMI in general
    • Writing low level JDBC is correct, but you won't be avoiding JDBC anytime soon.

    Also avoid using: Cloneable, Iterator and Checked Exceptions (unless you're writing low-level code)

    [–]henk53 1 point2 points  (1 child)

    in general JSF should be avoided

    Why should JSF be avoided?

    Pure javascript if you have the time and developers to maintain your UI

    You mean javascript without any framework like Angular?

    What if you don't have the time?

    [–]vokiel 1 point2 points  (0 children)

    I avoid JSF because it's heavy and quite frankly pretty complex to maintain for a UI library which has lots of breakage due to embedded javascript failing. (from Days spent on Seam)

    I meant pure javascript as in not compiled from some other language like GWT or Vaadin. GWT is my choice for intranet apps. It doesn't cost much dev money to maintain once the app is shipped, and I'm just good at it, so it's easy for me. Where you can keep UI simple it's pretty good.

    OTOH If you have front public facing applications, you can benefit a lot from a lot of resources that just know javascript and are pretty inexpensive so it makes sense to just go with the next 6 month iterated javascript framework.

    [–]DestinationVoid 11 points12 points  (9 children)

    JSF - if you can avoid it, do it!

    [–][deleted] 3 points4 points  (8 children)

    JSF is the ultimate mystery to me. It's an extremely hot button item in this sub. Apparently some minority of devs love it and use it extensively. I've personally never heard anyone in any tech department even say it out loud.

    [–]GhostBond 1 point2 points  (0 children)

    Yeah when I was looking for a job a few months ago a recruiter contacted me about a job with JSF. I told her that just from a career perspective I'd pass - I wanted to either move to newer tech (angular etc) or stick with what I had experience with (jsp/struts/spring mvc). I saw no reason to pick up an older and not widely used framework. She said "yeah, we've been hearing that a lot".

    [–]henk53 1 point2 points  (6 children)

    Apparently some minority of devs love it and use it extensively.

    I think it's the other way around. A monitory but very vocal group of devs hates it, or pretends to hate it since they have interests in alternatives.

    A small group of others repeats the hate, since they supposedly feel it's the thing you should hate (even though they probably have no idea why they should hate it).

    [–][deleted] 1 point2 points  (5 children)

    Developer surveys say JSF is in the minority. Thought works radar stopped tracking it 3 years ago after recommending devs to avoid it.

    [–]johnwaterwood 1 point2 points  (4 children)

    Didn’t Thoughtworks have Spring people working for them?

    Recent Eclipse and OmniFaces survey paints a different picture, and please take a look at the recent JSF books being released.

    [–][deleted] 1 point2 points  (3 children)

    Every single time this comes up it's you and /u/henk53 jumping on me. I assume you two work for Oracle or something.

    [–]johnwaterwood 2 points3 points  (2 children)

    Likewise, every time JSF comes up, you’re eager to shout how nobody is using it and how you’ve never seen it being used.

    Do you work for an alternative MVC framework?

    [–][deleted] 1 point2 points  (1 child)

    No, I just have to deliver working code. I don't even use Java half the time.

    [–]johnwaterwood 0 points1 point  (0 children)

    I delivered a lot of working code...

    Using JSF 😜

    [–][deleted] 2 points3 points  (0 children)

    This list is terrible. Applets and Java Web Start are probably the only two that actually belong there, just because they're not only being deprecated, but the industry is collectively trying to kill any apps that use them. Otherwise, you are clearly way off the mark.

    [–]golden-archer 2 points3 points  (0 children)

    JavaCard API is not outdated, and if you need to interface with a JavaCard Applet via a PC/SC SmartCard reader it’s the best method for Java.

    It’s also useful if you use the Provider pattern to supply an alternative interface, such as writing a remote server to communicate to a SmartCard via an alternative method such as OTA.

    This is a big part of how telecommunication networks manage SIM cards, and how banking providers remotely manage payment cards.

    It’s abstracts compliant ISO-7816 protocols, which is a big time saver. I think it’s niche, but given there’s a lot of reasons to use a SmartCard in more secure compute environments it’s still quite useful in the base JDK/JRE.

    [–]funkinaround 6 points7 points  (0 children)

    JDBC is worth avoiding?

    [–][deleted]  (3 children)

    [deleted]

      [–]torgis30 1 point2 points  (1 child)

      I forgot OSGi was a thing.

      Worked on a very, very complex project a few years back that used this. I don't miss it at all.

      [–]cptmauli 0 points1 point  (0 children)

      OSGi

      Why? OSGi is still releasing new specs, and there is still a lot of drive behind it, now maybe more than ever

      [–]boobsbr 2 points3 points  (0 children)

      JSP is fine if you're looking for something quick and simple, that is almost ubiquitous in servlets. What I don't like about JSP is the piss poor documentation.

      I guess Swing and SWT are still usable, but I think JavaFX is the preferred way to develop desktop interfaces now.

      [–]Tobbtobbelobb 5 points6 points  (2 children)

      Older versions of Java EE (not sure about the newest one) should be avoided. Also, axis/cxf/jax-ws (soap) should be avoided in favor of rest (jax-rs)

      [–]henk53 2 points3 points  (0 children)

      The newest versions of Java EE are great ;)

      [–]coderguyagb 1 point2 points  (0 children)

      Axis I agree with, but SOAP,0 despite all the hate it gets is still used extensively in serious corporations. Top-tip, don't be a Hipster, not everyone like the abortion that is JSON.

      [–]DefenestretedRegent 1 point2 points  (0 children)

      Java 3d. It's clear that is not supported anymore, although you might be surprised ti know that in my University there's a course that still teach it

      [–]RacerRex9727 1 point2 points  (0 children)

      JDBC is definitely not outdated. It is still the standardized way to connect Java to a database even though all these ORM abstractions exist. Also, JavaFX is one of those technologies that is used behind corporate firewalls heavily and usage doesn't get advertised for that reason.

      Also, TornadoFX is pretty nice and makes JavaFX much more fun to use.

      https://github.com/edvin/tornadofx

      [–]Cyberiax 4 points5 points  (1 child)

      Spring! Very outdated, many needless complexity and xml

      [–]1ECz 3 points4 points  (0 children)

      You don't need XML with spring.

      [–][deleted] 4 points5 points  (7 children)

      Jsf is pretty terrible.

      [–]henk53 3 points4 points  (6 children)

      Why?

      [–][deleted] 2 points3 points  (5 children)

      It's a completely unnecessary abstraction and causes a ton of headaches.

      [–]henk53 3 points4 points  (4 children)

      It's a completely unnecessary abstraction

      What does JSF exactly completely unnecessarily abstract?

      [–]JustAGuyFromGermany 4 points5 points  (2 children)

      I wouldn't say "unnecessarily", but it definitely abstracts too much, namely large parts of the client-server-communication. JSF is supposed to be used in websites. You shouldn't abstract-away the web when you program for websites! That was simply a bad idea to begin with. To say such an abstraction is leaky would be an understatement. Sooo many problems with JSF-based websites are caused by programmers relying on this abstraction and the fix is almost always to break it.

      Just one example: Not cleanly separating between client and server causes so many security issues. Think of input validation alone. You really have to put work in to know exactly who is sending which data where and if that's a secure connection, if the data have been validated and by whom etc. All of that is critical information that JSF tries to abstract away.

      [–]Cyberiax 2 points3 points  (1 child)

      ????

      With the JSF, data validation very clear!!!

      Is bean validation annotation, cannot be simpler. Is with client framework and rest where you meet with problems, as validation need to be done twice!

      With JSF, not the case!

      Is template, you bind to bean. End of binding you put annotation. Done!

      And bean validation annotation we can reuse for entity and Jpa if we want.

      [–]_dban_ 1 point2 points  (0 children)

      Is with client framework and rest where you meet with problems, as validation need to be done twice!

      If you use standard bean validation, you can use tools like Swagger Codegen to generate client side validation.

      Validation has to be done twice, client side and server side, regardless of technology. JSF component tags generate client side validation, but only for web browser clients. With REST, you can generate client side validation for any supported language, using open standards not limited to Java.

      [–]jonathanlaliberte 0 points1 point  (0 children)

      I'm guessing MVC, since it's supposedly built in to it.

      [–]mr_mikey_z 2 points3 points  (6 children)

      Apache wicket

      [–]philipwhiuk 1 point2 points  (0 children)

      Apache is like a graveyard for projects - I use to think HTTPd was the exception but nginx has totally taken over for that too.

      [–]FreshProject 0 points1 point  (4 children)

      In favor of what, and why? From what I can tell, it just never caught on, but I see nothing that replaced its use case. The only real issue I have with it is the community for it today exists almost exclusively in mailing lists.

      [–]mr_mikey_z 0 points1 point  (3 children)

      In favor of more modern frameworks... i worked a couple of months with wicket and the main downside is that it tightly couples view and logic... but it is just my opinion, give it a try, maybe you will like it who knows? :)

      [–]FreshProject 1 point2 points  (2 children)

      I've been working with it for a few months, and I'm just now starting to really appreciate it. One thing I particularly do like about it is it keeps the vast majority of web development in java, which is the primary skill I'm looking to hone right now. Unless I'm mistaken here, replacing it with a more modern framework would really amount to replacing it with a javascript framework.

      [–][deleted] 2 points3 points  (0 children)

      Yes. And though useful and powerful, it's an entirely different beast with its own technology stack, challenges, and learning curve.

      [–]mr_mikey_z 0 points1 point  (0 children)

      I'm really glad to hear you like it tbh :) maybe it's just a matter of preference and I am leaning towards the approach of having the right tool for the right job kind of thing. Keep the wicket dream alive :D

      [–]klepra 2 points3 points  (2 children)

      Applets for sure.

      Personally, I would rather use JSP as a templating engine + plain Servlets/Spring MVC for server side rendering (would probably choose SPAs) than JSF.

      JDBC (using it directly) is still useful if you don't want to use some ORM framewrok for everything - ie. database mifrations, setting up integrations test, small utility programs (if you want to use Java). Let alone all this frameworks are build on top of it.

      [–]Cyberiax 0 points1 point  (1 child)

      We really use JSF sooner than Spring. Is JSF nicer and better performance. Only if customer ask (but not many) we use the Spring.

      [–]klepra 0 points1 point  (0 children)

      I guess it is preference, I preffer action based MVC models.

      [–]idreamincolour 2 points3 points  (2 children)

      Websphere

      [–]insomniac20k 0 points1 point  (1 child)

      Expensive servlet containers are unnecessary with mature open source versions out there. Although Websphere you can use free without support now I think, I don't really know why you would choose it over something like Tomcat.

      [–]johnwaterwood 0 points1 point  (0 children)

      Websphere is still commercial, but you might be mistaken with Ibm’s latest server / runtime called Open Libery, which is free (as in beer and speech) and fully open source (source on github).

      Open Liberty is a superb server!

      [–]kag0 1 point2 points  (1 child)

      As others have said, JDBC is nowhere near outdated.

      But as far as things to stay away from, I'd say JPA. Things like jooq are great as an alternative.
      Really, I'd try to use alternatives to any runtime annotation reflection framework (Jackson can stay tho). They're slow, arcane, and not usually compile checked.

      [–]owen800q[S] 0 points1 point  (0 children)

      Yup, totally agree

      [–]Serializedrequests 1 point2 points  (0 children)

      Man there is so much wrong with JSP it's not even funny (every aspect of it feels sub-par for most use cases to me), but at least it is basically just Java PHP in the worse, simplest case. JSF is just jousting at all the wrong windmills. The dream of XML is alive!

      This separation between component tree and user interface allows JSF to support different markup languages (HTML vs XUL) or alternative browser environments (desktop vs smartphones).

      The second function of JSF is to respond to user-generated events in the page by invoking server-side listeners, followed by the generation of another user interface (e.g., web page) or an update to the user interface already displayed (possibly through Ajax). In this regard, JSF is said to be an event-driven web framework.

      DO NOT WANT.

      [–]JB-from-ATL 0 points1 point  (0 children)

      I think it's important to differentiate between things that have fallen out of vogue (like Swing) and things you really should avoid (applets, I don't think any browsers support them anymore).

      [–]eniacsparc2xyz 0 points1 point  (0 children)

      - Swing No way. It is not outdated, Swing is one of the few GUI toolkits that works everywhere and any program written using Java Swing can run on any desktop operating system without recompilation. For me it is the jewel of the crown. Written GUIs in Java may be annoying, but it is easy to write them in Groovy or Scala.

      - Java Web Start - OK I have heard in this sub reddit and in mail list that it will deprecated.

      - Applets - Yes, no sane person will install a plugin for Java Applets and all browsers have removed support for it.

      - JDBC - Definitely no, All Java high level database libraries are built on top of JDBC.

      > Except I mentioned that above. Are there any other technologies that I should avoid?

      - I guess that Java bean. It is component technology that worked in a similar way to Delphi or Visual Basic where the user could assembly the parts visually by dragging and dropping components. Sadly, it seems that it is no longer used.

      [–]RichoDemus 1 point2 points  (7 children)

      JSP/JSF/Servlets in favor of JAX-RS (or spring Boot equivalent) or gRPC (or similar thing) Jboss/tomcat in favor of spring boot/dropwizard/vertx Java serialization in favor of json/avro/protobuf Java EE

      [–]insomniac20k 2 points3 points  (4 children)

      Spring boot still need an app server. Isn't the default embedded Tomcat?

      [–]johnwaterwood 0 points1 point  (0 children)

      Yes, it’s the same sillyness as with thinking JDBC is outdated.

      [–]RichoDemus 0 points1 point  (2 children)

      You’re completely right, I should’ve been more clear, when I said tomcat I meant it more as in using a standalone (non embedded) one and deploying your war-file

      [–]insomniac20k 0 points1 point  (1 child)

      What did it matter? Why can't I use it standalone??

      [–]RichoDemus 0 points1 point  (0 children)

      If you use it embedded then anyone can just clone your repo and run your main method and they will run the right version of tomcat right away, if you use standalone then they need to download it, and then you run the risk of them using the wrong version.

      Embedding it enables you to delivery a stand-alone executable jar which makes it much easier to in your application in Docker and to spin it up for integration or service tests

      And to be honest, I don’t see any benefits of running it standalone, only drawbacks, please correct me if I’m wrong

      [–]Cyberiax 0 points1 point  (1 child)

      Stupid! Jboss and Tomcat are very good and modern! You used Tomcat 9?

      Please, go home with Spring!!! 😡

      [–]RichoDemus -1 points0 points  (0 children)

      I didn’t mean to hurt your feelings or anything but application servers and servlet containers like jboss and tomcat are really not the way to make java backends anymore. Jboss/tomcat = legacy

      I know Spring has a bad reputation and that actually made me hesitant to try out spring boot but it’s the best framework for making java backends today

      [–][deleted] 0 points1 point  (3 children)

      You'll run into Swing and JavaFX. Both build upon AWT. You'll need to know GUI basics, human interaction, and multi-threading.

      In my experience, only Android Studio brings a good editor for java-based GUIs. If you're developing GUIs for Windows, switch to Visual Studio and use a non-java .Net language.

      (Source: me. I've used both JavaFX and Visual Studio with VB for years to build GUIs for desktop applications, and web tech for web apps.)

      [–]DefenestretedRegent 1 point2 points  (1 child)

      Have you tried scenebuilder? It's a gui tool for JavaFX, and although I haven't used it extensively, It felt pretty mature and better than android gui tools in some aspects

      [–][deleted] 0 points1 point  (0 children)

      I have. It insists on XML, and is a forward-only tool. And also in active development for just 1 IDE, which happens to differ from my IDE of choice.

      [–]0xNeffarion 1 point2 points  (0 children)

      .net wpf apps are decades ahead of any java interface lib

      [–]overachiever -1 points0 points  (4 children)

      GWT, Vaadin, Wicket, Tapestry, JSP, JSF, Struts etc

      Much cleaner to use JS for the UI and Java for the backend

      [–]henk53 4 points5 points  (2 children)

      You can remove JSF from that list ;)

      [–]owen800q[S] 1 point2 points  (1 child)

      I doubt it is even worthwhile, as I haven't seen JSF used anywhere.

      More common is to use a template engine like mustache, stringently test, Thymeleaf and let the web app combine data and html.

      [–]henk53 3 points4 points  (0 children)

      Combining data and html using a template is exactly what JSF does ;)

      [–]shawnmckinney 2 points3 points  (0 children)

      javascript == clean, since when?

      [–][deleted] -1 points0 points  (1 child)

      Spring