r/learnjava • u/Pseudo969 • Jul 19 '22
Why is Chad Darby's Spring very difficult?
Six months ago, I have absolutely zero knowledge in programming.
In this six months period I have learnt HTML, CSS, JS, React, and Finally Java. While I was learning these technologies I didn't feel there are gaps between what is being taught and what is already taught. After the courses I was successfully able to develop basic projects on my own.
Last week I have started Chad Darby's Spring course. The teaching is fine and all but the configuration is extremely difficult. For example, While creating a CRUD- MVC application, Chad has asked to import XML files where the data is all greek and latin. He has created connection using JDBC. Then in the jsp pages he wrote some taglibs and simply asked us to type it as it is.
What if I want to develop an App on my own? How do I know what to write in taglibs? How do I know what to write in xml files? How do I know what JAR files to download? How do I know what to write in JDBC Connection file?
Looking for suggestions from any captain who has crossed this phase!!
18
u/dipanzan Jul 19 '22
I've been in your shoes exactly two years ago. I joined a company which used Spring/Boot for their backend services and I was just an Android dev back then. Since Chad's and SpringGuru is almost always recommended in the subs, I bought both.
Here's the thing: Chad's course starts with bare Spring. Almost all of the companies/services out there are Spring Boot now which is essentially Spring but the configuration part is more or less done for you, you just have to choose the flavor which caters to your workload.
When the senior devs asked me to learn Spring, I actually started with Spring Boot and was understanding the bits and pieces but to my surprise when I was actually tasked with actual fixes/maintenance at the company, it was a 6-7yrs old legacy project which was only Spring and XML configuration.
My advice would be: if you are just starting out and you want to spin up services or work for a company and know that they use Spring Boot, just start with Spring Boot because all the tutorials/guides out there are using Spring Boot nowadays. The legacy way of manually configuring and especially using XML config is not the preferred way anymore!
Also if you want video tutorials, check out JavaBrains, he has a lot of good stuff on the newer practices and uses Spring Boot.
Also check Marco Behler out: it's more like a big TLDR about Spring, Java and JVM (all the good stuff): https://www.marcobehler.com/
1
3
u/Yithar Jul 19 '22
Almost all of the companies/services out there are Spring Boot now which is essentially Spring
That's not entirely true. I worked for an investment bank and they still were using XML.
There's a lot of legacy code out there. Generally if it works they're not just going to change it to Spring Boot just because.
Like sure, the newer services are going to use Spring Boot, but you'll still have to deal with legacy code so it's important to be able to work with plain Spring as well.
2
u/dipanzan Jul 19 '22
Yes I agree, I actually learned the most when I was given the task of migrating that legacy Spring app to Spring Boot. Thus the recommendation was that if OP knows that the company he's going to work for does not use bare Spring, then it's best to start learning Spring Boot and not XML.
Banks are notorious for sticking to legacy stuff, so there's that.
4
Jul 19 '22
Yep I picked up because it was so highly recommended but it was very difficult. I didn't even know the difference between spring and spring boot. Learn spring boot first and if needed get into spring. Checkout YouTube channel javabrains
2
u/Pseudo969 Jul 19 '22
will check that out... But people are saying we should know spring so that we can easily learn spring boot?
3
Jul 19 '22
Spring is very old school and weird. Learn spring boot build a bunch of webapps. Then get into spring-data and spring security. That's all you need in practice. Once you understand these learning spring will be easier. Complete a bunch of projects from YouTube
1
u/Pseudo969 Jul 19 '22
Just checked out the Java Brains channel.. It seems amazing.. I was actually planning to learn Spring Boot with Microservices Architecture. The course on microservices seem very small (only some 3-4 hours). If possible can you kindly paste the playlists which are to be learnt to master Spring Boot and Microservices?
Thanks in advance.
3
1
Jul 19 '22
The Microservices course in Java brains is not actually a course, it's more of a code along, if you don't have an understanding of spring boot jumping into the Microservices architecture's gonna fry you.
Maybe try some CRUD api 's with spring boot, there's plenty on YouTube.
1
u/Pseudo969 Jul 19 '22
Yep.. Even though I don't understand the config part of Chad's course, I am planning to sit through it and planning to complete entire course and check out boot with micro services only after that.
BTW there are other playlists in the channel (for eg: highly scalable good reads app or IPL score board with react and Spring boot). Are these too of microservices architectural patterns?
3
u/sksisisisuwu Jul 19 '22
why the hell do you think? you started programming 6 months ago. knowing all those languages well enough qualifies you to be a full stack developer. that’s like expecting to cure cancer after going to med school for a year. learn one language very well, and learn OOP concepts + basic computer science before you try to dive into 50 different frameworks. it should be pretty obvious you’re going to have no clue what you’re doing if you’re moving at that fast a pace
1
u/Pseudo969 Jul 20 '22
I think you got my point wrong. I don’t have problem with understanding the concepts. I find it difficult if the instructor doesn’t explain a concept and simply asks me to copy the files. I am bothered what’s the point in copying if I don’t know what’s happening inside or what I files I should use when I am doing projects on my own.
2
u/sksisisisuwu Jul 20 '22 edited Jul 20 '22
so let’s break it down then. first of all, the configuration file for hibernate’s SessionFactory (aka the one chad provides) is just standard XML. the properties should be pretty self explanatory, except maybe the driver and dialect. the driver class is the code written by the database provider allowing you to actually connect to the database, and the dialect is the way in which hibernate will send and receive sql
most of those properties you’re configuring just deal with how hibernate connects to the database in the first place, and as such chad rightfully felt it wasn’t really necessary to dive into it, especially since there are other easier ways to connect (like Spring Data JPA).
and don’t get so caught up on JSP. taglibs are just import statements, since JSP is basically HTML with custom tags allowing you to easily interact with Java objects. you said you know React, there’s no point in even looking that far into JSP then. it’s ridiculously outdated, chad is just using it because the course is Spring, not fullstack.
7
u/GhettoSauce Jul 19 '22 edited Jul 19 '22
I was tasked with learning Spring for school and I couldn't find decent resources aside from the Spring documentation itself.I got the book "Spring in Action" but it wasn't quite working for me.I figured I'd get Chad Darby's course to give myself an edge, but yeah, the config he's using was breaking stuff because it was old/deprecated. Once I managed to get through that, it was better. Still, I found his style really slow and leans too heavily on constant "hey, I'm nice, you're amazing, wow" positive reinforcement (while his stuff is breaking my head and IDE, lol)
I managed to get some small projects going. Trawl the internet as best you can and you'll get there. I didn't; but I know it's possible!
edit: minor typo
6
Jul 19 '22
It's just spring MVC part that is hard, if you can sit through these, spring boot will be just a breeze.
Spring boot was introduced to reduce the configuration in normal spring MVC app.
Courses still teach spring MVC because it is good to have an idea of how things work in the back.
4
u/krisko11 Jul 19 '22
I find it hard to believe OP learned all those technologies and is tackling spring in 6 months time. Spring is a beast of its' own. In modern times we don't use JSTL tags and JSP pages, we don't configure beans via XML.
At least in my firm we use mapstruct, JPA and other codegen libraries like Lombok to reduce the boilerplate code. Most of your configurations will be done via annotations and code-first-approach programming.
For a Spring course that's ok to follow I'd suggest Amigoscode, but honestly it's still not good enough. When I was going through course materials I was following Tim Buchalka's course on udemy and I was very happy with it. He shows the "oldschool" way as well as introducing the MVC model with annotation-based configs.
The best way moving forward would be to use one of your basic projects and spin up a web app following REST api specification, write a few integration tests, build a simple controller and service and then use your skills to develop static resources to populate some content.
Final touch would be - recreating the to-do list app from scratch (the most common example project with spring boot)
1
u/krisko11 Jul 19 '22
MVC is a design pattern, not a model.
1
u/thisisjustascreename Jul 20 '22
How is a design pattern not a model?
1
u/krisko11 Jul 20 '22
Do you use those words interchangeably? Model and design pattern are two different things.
3
u/thisisjustascreename Jul 20 '22
Well if you strictly consider the "model" in the acronym MVC then sure. But if I said "a design pattern is a model for how to solve a certain class of problem" and you said that was wrong... what?
1
u/Zpd8989 Jul 19 '22 edited Jan 06 '26
memory hungry one serious whistle smile dinner existence jellyfish imminent
This post was mass deleted and anonymized with Redact
3
u/Yithar Jul 19 '22 edited Jul 19 '22
As stated, the whole reason that this seems convoluted and hard is that Spring MVC is hard.
Then in the jsp pages he wrote some taglibs and simply asked us to type it as it is.
I actually think Chad Darby is very correct in saying to just type it as it is. JSP is like JSX. It's a whole language.
How do I know what to write in taglibs?
It depends on what custom tags you want to use in your JSP file.
The Oracle docs give an overview of the different types of tags and what taglib to include:
https://docs.oracle.com/javaee/5/tutorial/doc/bnake.html
Looking for suggestions from any captain who has crossed this phase!!
I've finished his course and the thing you have to understand is he's giving you a foundation. If you just want to bootstrap an App easily you can use Spring Boot. But here's the thing. You'll get a working app, but you'll have no idea what it's actually doing. And that's what you're learning before Spring Boot (he has a section on Spring Boot at the end).
Knowing what's going on under the hood may not matter when things work, but it matters a lot when debugging issues.
2
u/mr_poopybuthole69 Jul 19 '22
I also bought this course. I have a feeling he's explaining it too hard. Just learn spring boot instead of spring.
2
u/tcloetingh Jul 20 '22
I personally think chads course sucks… it’s 50% config in each section with no good explanations and lightly covering topics. The book ‘Spring start here’ is a way better resource imo.
1
u/CSIWFR-46 Jul 19 '22
https://youtube.com/playlist?list=PLOk4ziGG9MBdlyxIDw5wYvj6QZTQ22wvK
Check this playlist on Spring and thank me later.
1
24
Jul 19 '22
[removed] — view removed comment
1
u/Pseudo969 Jul 19 '22
yeah!! I think I will just copy what he's saying regarding config files and will hope that I will be only working with Spring Boot in future.
2
u/alaskanloops Jul 20 '22
The pluralsight course I took at the beginning of this new position was pretty solid, but requires a subscription of course.
Edit: this is it https://app.pluralsight.com/library/courses/creating-first-spring-boot-application/table-of-contents
•
u/AutoModerator Jul 19 '22
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 - best also formatted as code block
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.
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/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis) 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:
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.