Happy Coding

Java path


#1

Kevin,
For anybody getting serious into web development using java, what would be the path to follow, or what is recommended to learn or to master at a minimum in this journey?

Do you have any recommendations in addition to working with the java SDK documentation?

I suppose this involves managing any libraries or frameworks. Thxs,

Kf


#2

Hey K!

That’s a good question, and it’s one I struggled with myself for many years. I’ll try to answer the best I can.

First I’d start by learning HTML:

This is because HTML is the end result of web development. The coolest server-side code can’t do much without HTML! If you haven’t already, put together a basic personal webpage, or export your Processing or P5.js sketches to the web and add stuff like titles, descriptions, and styles.

At this point I think JavaScript is optional. You can always come back and learn that later.

Parallel to that, I’d recommend learning the fundamentals of programming using Processing:

(I think you’ve already done this step, but I’m including it for completeness.)

I recommend Processing because it uses “real” Java syntax (in fact it’s built on top of Java), so learning Processing is learning Java. Try to get familiar with using objects and creating classes before moving on to “real” Java.

When you’re familiar with those concepts, then I’d say you’re ready for Java. Honestly this is probably the hardest jump, from Processing to Java, because Java has a lot of boilerplate code that you won’t understand right away.

To learn Java, I’d recommend working through these tutorials:

Specifically, I’d try to give yourself a [Swing]https://happycoding.io/tutorials/java/swing) project, or maybe try using Processing as a Java library. Mostly you’re looking for an excuse to learn about inheritance: this is a must-know topic for more advanced programming.

Finally, when you’re comfortable with classes, objects, and inheritance, then I’d say you’re ready for server-side Java, aka Java EE.

I have a few tutorials that walk you through the setup for server-side Java here:

And I’m actually planning on going back and overhauling these over the next few weeks, so your question comes at a good time.

To get started, you only really need one .jar file that contains the Java servlets library. This .jar file comes with servlet containers like Jetty or Tomcat. (Jetty tutorial here.)

But you’re correct that more advanced projects are going to involve more libraries and frameworks. For this I’d recommend using something like Maven. I don’t have any tutorials for this yet, but I hope to put something together soon.

Like I mentioned above, I’m planning on going through and updating the server tutorial over the next few weeks. Specifically I think Google Cloud actually has some really cool tools, so you might want to check those out too. This page is a really great place to start.

Let me know if that makes sense. I’m going to be thinking about this in the very near future, so I’m always happy to talk more about it!


#3

What are your thoughts about hibernate and spring libraries (maybe they are frameworks?). Have you heard about vaadin? What other libraries would be common in the web dev realm?

What sort of updates are you planning to implement to your Java EE tutorials? Like migrating from java 7 to 8 and use annotations for your routing for instance?

GCP sounds cool. However I feel that using cloud technologies removes a level of abstraction when working with web technologies (or maybe adds one level depending on the experience using this technology). I am looking to master core concepts and I would prefer to manage my own local server while working with examples. Moving it to GCP would be interesting but it could be done later. I am more interested to run my own server to learn to do the setup properly. Also working locally will allow faster testing.

Kf


#4

I’ve used Spring and Hibernate. To oversimplify, Spring is a framework that helps execute code when a particular URL is requested. It’s handy for building projects with complex dependencies. Hibernate is a layer that sits on top of a SQL database, and lets you write Java code and interact with Java objects instead of getting your hands dirty.

They can both be useful, but honestly if you’re just starting out, I’d recommend starting with something simpler. Learn about servlets, and put together a basic hello world example.

Yep, those are two good examples. Basically I’m developing a curriculum for Google Cloud, which contains a bunch of cool tools.

Yeah, Google Cloud definitely adds a layer of abstraction. However, with the approach I’d take, you’d still work from basic servlets to understand how everything fit together underneath. After you have a grip on that, you can expand and get into the more complex stuff like frameworks.

I personally have never been interested in maintaining my own server. As long as I can deploy my code, I haven’t really cared about the hardware side. If you’re interested in hardware I say go for it, but I don’t think you necessarily need to host your own server to write server code.

You can deploy locally if you’re using Google Cloud. In fact that’s one of the things I like about it: spinning up a local server is a single maven command.


#5

So hibernate is an ORM? Would be useful to create a second tutorial of your database tutorial but using hibernate instead?

Is it possible to see this curriculum that you are developing or is it top secret? This would be a very exciting material. I am working on GCP as we speak directly using their documentation.

Kf


#6

Yep, Hibernate is an ORM. I don’t have any plans to write a full Hibernate tutorial (more accurately, I have plans for a bunch of other stuff and only a limited amount of time to do it all, heh), but I do mention a couple techniques for converting database data into Java objects in the databases tutorial:

You can absolutely see the curriculum, as soon as I put it together. That’s my plan over the next few weeks, but I don’t have anything to show just yet.