.NET Developer tries Java Spring

  Рет қаралды 78,691

Raw Coding

Raw Coding

Жыл бұрын

.NET developer tries the Java Spring framework. Looking at the daily life of a Java developer & some beans.
Patreon 🤝 / raw_coding
Courses 📚 learning.raw-coding.dev
Shop 🛒 shop.raw-coding.dev
Discord 💬 / discord
Twitter 📣 / anton_t0shik
Twitch 🎥 / raw_coding
👉 Try Rider
www.jetbrains.com/store/redeem/
RD5K9-4TXXW-KMV3G-NYWSF-3ZSTP
#aspnetcore #spring #java

Пікірлер: 321
@auniquehandle
@auniquehandle Жыл бұрын
"the fuck is a bean" same bro, same
@RawCoding
@RawCoding Жыл бұрын
Some mysteries will never be solved 🫘
@zxopink
@zxopink Жыл бұрын
3:42
@9SMTM6
@9SMTM6 Жыл бұрын
I spend almost a day trying to find that out, but only got a rough idea - I know some things commonly referred to as Beans but they seem like different things to me. There seem to be lots of conflicting definitions and/or the magic confused everyone. Eventually I just fame up and replaced every occurrence of beans with magic and went with it. Spring is a mess totally overreliant on automagic.
@adamc1694
@adamc1694 Жыл бұрын
@@9SMTM6 If you people are not old enough to know the history, then I can share what I know. At the beginning when the WWW had just begun. Sun the company that created Java tried to cook up a web application framework. Yet since that was new and nobody really had a clue of what to do. So Sun using their frame on Java published hundred pages of specification with so many fancy terms J2EE, XML, SOAP, JSF, JNDI, EJB... (yes Java Bean was only one of them) just to confuse to the people. You heard about the IT bubble? Yes, Sun was trying to create the hype, boost the stock, sell the stock and get rich with easy. Java Bean at time was nothing more than any regular java object with a getter and setter method. Yeah that is all about it. Supposedly Sun's J2EE proposal was about container, a term still being used as of today, and java bean can organically and automatically duplicate itself across the network in different containers in order to fulfill enterprise level of traffic demands. But of course as I mentioned at the beginning, Sun actually had no clue how to actually implement it. People tried to follow J2EE, too complicated, got into a mess... They wasted all the time and resources. Had to do every =thing from ground zero again and newer frameworks like Spring, Hibernate started to emerge.
@9SMTM6
@9SMTM6 Жыл бұрын
@@adamc1694 yeah, it's been a while, but I was certainly aware of that definition. It may actually be the only real definition of that term, just it appears incompatible to how that term is used in Spring at times. Or perhaps I was just not getting it. But frankly yeah that "fancy terms" explosion is certainly a thing in that area. It's quite... Bad. The main issue with these terms is that their modern usage often is far removed from their original definition, which often wasn't very clear and just - often without reason - convoluted to begin with. Like, I've studied Physics, and I'm happily privately using Rust, but the thing with these topics is that while they are complex, they're also well defined and use terms... Well mostly consistent. The Java ecosystem meanwhile? Damn thats one big mess I just want to get away from. I mean yeah it's not that different from some things today I guess, like, were all using "REST" when really often what were writing with these approaches is far removed from the original ideas behind that term, but it seems Spring in general is just that kind of thing everywhere.
@rubenvervaeke1635
@rubenvervaeke1635 Жыл бұрын
Don't have experience with Java & Spring and immediately starts out with Spring Security, that's brave my man.
@salaman894
@salaman894 Жыл бұрын
In fact, that was crazy
@YariRu
@YariRu Жыл бұрын
The secret is to use very long class names like AbstractAnnotationConfigDispatcherServletInitializer
@denissorn
@denissorn Жыл бұрын
With auto completion and good editor it's normally not an issue unless one overexaggerates or has a lot of generic types, unless one is forced follow silly Python like guidelines. Using such names can be helpful when using tools like github copilot.
@kendlyduprince
@kendlyduprince Жыл бұрын
You mean plain English so everyone can read it and get what it does? Yeah
@RustedCroaker
@RustedCroaker Жыл бұрын
It's called self-documented code. Try it once, never will go back
@verified_tinker1818
@verified_tinker1818 Жыл бұрын
I read that as "SovietInitializer".
@muyewahqomeyour7206
@muyewahqomeyour7206 Жыл бұрын
@@denissorn what silly guidelines?
@Toradoshi12
@Toradoshi12 Жыл бұрын
Aspect Oriented Programming a.k.a. introducing bugs under the hood is the backbone of Spring.
@RawCoding
@RawCoding Жыл бұрын
Hahahaha
@yeumkyuseok
@yeumkyuseok Жыл бұрын
Im amazed at how you could code on the spot in such an unexperienced framework/environment this flawlessly!!
@Toradoshi12
@Toradoshi12 Жыл бұрын
There were definitely flaws.
@gismtomar6812
@gismtomar6812 Жыл бұрын
no its called faking.......he did all of it before hand obviously
@RawCoding
@RawCoding Жыл бұрын
​@@gismtomar6812 Just for context, I work with Java for Android, so I have some familiarity. I've never touched Spring before I hit record on this video, the 20 min video took about 2-3 hours to record, in between the cuts I am googling around for how to Spring. the only thing I faked was the smile while writing this, the experience it self was painful.
@karimpardayev
@karimpardayev Жыл бұрын
@@RawCoding 💀
@bjarne9700
@bjarne9700 Жыл бұрын
i mean... this is exactly how you learn stuff. You look at tutorials, copy, paste, try to understand and thats it. You could do the same, provided you are familiar with the environment like he is. You need to know some Java, some gradle or maven and you definetely need some experience because in 99.999% of the time experience translates to other fields. If you know how to do a backend in C# you know the base concepts and you know the flow of things. Of course that doesnt mean you know how Spring works, but you know what it has to do and what it will be capable of.
@unhandledexception1948
@unhandledexception1948 Жыл бұрын
I honestly love watching this guy, his humour just brings to life any technical topic ....awesome channel ;-)
@fudosker
@fudosker Жыл бұрын
It might seems like complicated staff, but only on start of the project... Now you can use spring boot which comes as part of code that performs basic configuration at runtime
@kutilkol
@kutilkol Жыл бұрын
Man you're good! That was some quality content, thx
@lucasmontec
@lucasmontec Жыл бұрын
Also, you can write SQL in attributes (annotations) of those query methods. Lifetimes are defined by the type of "service" you are creating. Repos have a lifetime, services have another... All is registered automatically on startup.
@JonneKleijer
@JonneKleijer Жыл бұрын
Insightful! Thanks for sharing your insights. Could you do a similar video on NestJS?
@Narezaath
@Narezaath Жыл бұрын
The one-liner authentication you've heard about is probably the simplest Spring Security authentication, which is just adding the library to your Maven/Gradle config and maybe an annotation. That is all, like, literally. At the start Spring notices you want authentication, sets it up for you, provides you with a default user and password and you can use those to authenticate. Done. If you want to configure it further then yeah, you'll have to jump through some hoops, like what you've experienced. You first specify the route either explicitly or by a matcher, then decide what to do with it: permit access without authentication or allow only authenticated users. JPA stands for Java Persistence Api, which should tell you what it's for. :)
@you0neville0tube
@you0neville0tube Жыл бұрын
EF also lets you have setups without having migrations (some default templates do it). If you are just querying all data you wouldn't have to use LINQ in EF either
@chillydill4703
@chillydill4703 Жыл бұрын
"I don't know what kind of teleportation going on here" cracked me up bad LOL🤣🤣
@IvanRandomDude
@IvanRandomDude Жыл бұрын
I work with both. Aspnet core is definitely easier to master and is innovating faster than Spring. Spring is huge, has like 50 different sub-frameworks and is being developed slower. I also like EF core more. Spring JPA looks great but as soon as you need complex queries it becomes a mess. Nobody even uses it for complex stuff, for complex queries we usually use jOOQ or some other library (they basically use LINQ-like syntax to build queries)
@RawCoding
@RawCoding Жыл бұрын
thank you for the insight! I thought that would be the case, and what about authentication was I doing something messed up or that's just the way it is?
@IvanRandomDude
@IvanRandomDude Жыл бұрын
@@RawCoding You don't have to create login endpoint, it comes predefined out of the box. Similar to how login and some other pages come out of the box if you use AspNet Identity Default UI. You can, of course, create your own (scaffold + edit). Also, if you chose to create your custom login page, you should include hidden input with name="_csrf". That way, csrf token will be included in form so you dont have to disable csrf (bad idea as you said) What was wrong in this video is: Once you define loginProcessingUrl you have to implement the login logic yourself (check the password, set authentication in HttpContext etc...). Since you didn't, login processing handler was basically empty and it didn't authenticate user. JSESSIONID cookie is created regardless if you are authenticated or not, it is just session cookie. Whether your session is authenticated or not is a different story. This is different from aspnet core where AspNetIdentity cookie is created only if you are authenticated. JSESSION actually does not come with security, it is created even if you don't include security library.
@IvanRandomDude
@IvanRandomDude Жыл бұрын
But after watching part of your video again, I can say it is not your fault, the guide you were reading is TERRIBLE LOL. All you need is .formLogin(withDefaults());
@macctosh
@macctosh Жыл бұрын
I can write any complex query with @query. So I don’t know what you are talking about
@IvanRandomDude
@IvanRandomDude Жыл бұрын
@@macctosh Well, good luck with having long sql queries as string in your code
@rade6063
@rade6063 Жыл бұрын
Great video
@wlockuz4467
@wlockuz4467 Жыл бұрын
The only thing stopped me from going completely insane when I used to work with Spring was Intellij IDEA
@alexlo5655
@alexlo5655 Жыл бұрын
Thank u for the interesting video. Did you try to implement asynchronous code in Java/Spring? It would be interesting to compare ASP vs Java/Spring.
@Toradoshi12
@Toradoshi12 Жыл бұрын
Asynchronous code is pretty much handled by Reactive frameworks and is kind of a mess.
@alexlo5655
@alexlo5655 Жыл бұрын
@@Toradoshi12 So we need to use third party library(s) to achive async programming and there is nothing build-in async in Java or Spring?
@Toradoshi12
@Toradoshi12 Жыл бұрын
@@alexlo5655 well not exactly, Java has your more traditional tools for implementing asynchronous code, and Spring is more annotation shenanigans for their asynchrony. Neither of which is particularly ergonomic to develop in. Spring has brought in a new framework in recent years called RxJava that has more or less become the de facto way of writing asynchronous code for enterprise apps.
@oumardicko5593
@oumardicko5593 Жыл бұрын
For any JVM related stuff, i use kotlin. Easy to use, innovative, no complex BS or verbosity. Kotlin has a backend framework called ktor and i can say, the language has some of the best developer experience i have seen.
@mazymetric8267
@mazymetric8267 Жыл бұрын
But if you're looking to get hired, Spring Boot is the way to go. Spring Boot also provides support for Kotlin if you're a Kotlin fan.
@RustedCroaker
@RustedCroaker Жыл бұрын
Our deepest condolences! Hope you'll find your way back to the bright side eventually
@mikhalpalych
@mikhalpalych Жыл бұрын
@@RustedCroaker i wonder if by bright side you assume java
@RustedCroaker
@RustedCroaker Жыл бұрын
@@mikhalpalych of course I'm
@justSomeUserOnYT
@justSomeUserOnYT Жыл бұрын
Removal of verbosity shouldn't be seen as an inherent "pro." That is why we have javascript and all of its ridiculous problems that don't support developers.
@BradleyWeston92
@BradleyWeston92 Жыл бұрын
You got further then me :) I tried Java (+Spring) for a side project wrote my business logic and unit tests then tried to integrate with Spring got as far as authentication in a rest API and ended up giving up and quickly rewriting it back in Go. Their docs have a long way to go sadly.
@muhamad8654
@muhamad8654 Жыл бұрын
Are you happy with go?
@user-yv7hk7tg2f
@user-yv7hk7tg2f Жыл бұрын
Spring Security is a huge topic in Spring...I can said i spend over 1 month to figure out what is going on, but no doubt, it is powerfull, but also hard to learn
@petru-cristianboza5933
@petru-cristianboza5933 Жыл бұрын
I'm not sure how asp looks like. I do agree on the security part, it seems a bit hard, sometimes like "whack a mole" But the ORM stuff can be done a lot better than what you described here with just some more insight on the framework. For complex queries we use JPA Specification which allows you to create queries easy to maintain and modify. I would agree on the fact that it has somewhat large learning curve, especially if you spend a day on it, but after some time, things do become a lot better :D Thx for the video
@Vortex-gz8se
@Vortex-gz8se Жыл бұрын
Specifications are an abomination. Just write HQL/JPQL.
@petru-cristianboza5933
@petru-cristianboza5933 Жыл бұрын
@@Vortex-gz8se not really, they are amazing especially when you need to do complex queries, you can always pair specifications with criteria builder to make everything better
@TheCameltotem
@TheCameltotem 10 ай бұрын
"Bean, what the fuck is a bean" Literally thought what you said out lmao.
@gylkag
@gylkag Жыл бұрын
I really wish people would stop doing this thing where they try a complex tool they never used before for an hour and give there opinion to an audience. That's the definition of uneducated, baseless opinion. You haven't done the absolute basic todo-app level stuff and thinking that if you couldn't figure it out in an hour by yourself without reading documentation - then it's the tool that is the problem. And we're not even talking about complex stuff (the stuff it was actually meant for), complex scenarios. That is so... weird, to say the least.
@VincentFree
@VincentFree Жыл бұрын
Maybe a bit true but it does resemble the learning curve of spring. I always struggle with it when I have to use a spring app. I normally use other toolkits for development but every time I'm in spring I'm just lost due to missing how the magic works. It's just not clear to use. It's like having to learn another language within a language.. Ik know java/kotlin/scala etc and I'm quite proficient in them but spring just makes me feel like a junior.. It's very limiting since easy stuff just becomes very hard imo.
@adamc1694
@adamc1694 Жыл бұрын
@@VincentFree "I'm just lost due to missing how the magic works."
@gylkag
@gylkag Жыл бұрын
@@HolyRamanRajya Where is gate-keeping in my post? All I said is that maybe it's not a fair thing to give an opinion on something you have barely used. I mean, we all do that - try something and then as a species with a brain we form an opinion of it, and the more we use it - the more we correct our opinion (if needed) and in private we exchange those opinions with colleagues, and often with harsher words and it's fun. The problem I have (so to say) is that since such opinion has almost no value by definition then it shouldn't be spread among large audience. IMO, it lowers the person that does that. Phrase "they don't know what they are talking about" means literally that. PS. I re-read my original post and it did sound too harsh, I should've worded it more... friendlier I guess.
@fredrikmardenfalkhoppe494
@fredrikmardenfalkhoppe494 Жыл бұрын
Agree completely. This kind of videos is just silly. You're dooming an entire framework because you can't pass a guide right away…
@m_stf
@m_stf Жыл бұрын
php is the most popular i guess, is there something in it ?
@GavrilosZ
@GavrilosZ Жыл бұрын
im java dev and u are doing great trust me :P
@AshishLohia70
@AshishLohia70 Жыл бұрын
use spring starter to add postgres, it will add the correct driver
@FDominicus
@FDominicus Жыл бұрын
How can one expect that there will be no learning curve?
@Qrzychu92
@Qrzychu92 Жыл бұрын
so, I don't get why people hat on EF Core. Just do do the repositories at all, the DbContext is a repository on its own. To get all all todos you don't really need any LINQ, to get a thing by id you can use linq, or a DbSet methods. And I guess, authentication is always a mess :D will you try ktor to compare it to spring?
@MiMachoAlQueLeChupoLaVerga
@MiMachoAlQueLeChupoLaVerga Жыл бұрын
As a .Net Core developer, I don't find any reason to swtich to Java or include in my skills. Everything that is done in Java and it´s frameworks can also be done in C# and .Net.
@trickyagent127
@trickyagent127 Жыл бұрын
Yeah the hardest thing to find is explanations on HOW a lot of this stuff works, though I've found Teddy Smith: www.youtube.com/@TeddySmithDev has a decent playlist that not only goes into how to use Spring Boot, but also he gives basic explanations on how it works
@rizaanjappie
@rizaanjappie Жыл бұрын
The word bean just puts me off.
@theyreMineralsMarie
@theyreMineralsMarie Жыл бұрын
Love it or hate, Spring pays the bills.
@RawCoding
@RawCoding Жыл бұрын
That’s the important stuff
@HolyRamanRajya
@HolyRamanRajya Жыл бұрын
@@RawCoding ROFL
@sauravbhatta5303
@sauravbhatta5303 Жыл бұрын
Hey dude! What’s the plan for 23?
@amnesia3490
@amnesia3490 Жыл бұрын
not writing Java ?
@RawCoding
@RawCoding Жыл бұрын
exactly!
@plurallyplurally7948
@plurallyplurally7948 11 ай бұрын
I'm coming from C/C++ & Go and I feel like Spring meanders a lot! Too many files to create and a lot of unnecessary jargon. It's giving me a hard time. I believe the goal of a framework is to simplify the operations in a language but with Spring I don't think its doing that!
@shreyasjejurkar1233
@shreyasjejurkar1233 Жыл бұрын
3:40 😂😂😂😂
@MsFico2
@MsFico2 Жыл бұрын
Yeah, I have to rant as a person that has been working with Spring for about 3 years now. First off, Spring Security is so bad they decided to deprecate it and they just say "Look, if you want u can use it, but just use Keycloak or some other service, you're going to have a MUCH better time". Like, it's giga bad. Your implementation was also quite simple and you had a hard time, imagine if you want to add custom properties to those users, what if you wanted to generate your own tokens with a custom hashing function, what if you wanted JWT, like, it's just horrid. Secondly, Beans are actually just singletons and are left over from the OG Spring. In Spring Boot they are mainly used for small configuration setups where you have some class that exists and you can't alter to make it a component/service/controller or whatever else, so you define it as a bean so that you can do DI with it. How it works with Spring Boot is that you create a class, and then specify whether it's a @Service, @Component, @Configuration, etc. (something like in .NET Core, but instead of having a separate config/Program file you'd do it on the class itself with an annotation). And finally a rant on JPA. It's fantastic and magical and that's the main reason I'm still sticking with Spring rather than .NET, I can't stand the EF Core, but Many-To-Many relations are SO BAD it's unbelievable. General rule of thumb in Spring developer circle is try to avoid implementing those relations, and if you have to, create an intermediary entity that will have 2 one-to-many relations and then try to avoid fetching them as much as possible. For custom queries we have a ton of different possibilities like QueryDSL, JPAQuery, @Query and a whole slew of other options, so it isn't painful in the slightest (only thing I'd maybe call painful is transaction management since it does TOO MUCH magic). Sorry for the rant, and thanks for coming to my Ted Talk.
@facu454
@facu454 Жыл бұрын
Spring security deprecated? Wtf
@MsFico2
@MsFico2 Жыл бұрын
@@facu454 i read it somewhere semi-recently, couple of months ago, it seems they're still rolling out updates, but I know for a fact that the discussion for deprecation of it exists/existed. And the main point was there are much better solutions and you should use Spring Security just to "connect" to said services.
@mazymetric8267
@mazymetric8267 Жыл бұрын
​@@MsFico2 They never deprecated Spring security as a whole. Spring Authorization Server was deprecated for a few months in 2019 but it was still maintained. There were no issues with Authorization Server according to the Spring Boot team. They only suggested low code alternatives like Gluu and Keycloak because they're way much easier to implement. As of right now, production-ready Authorization Server is available on Spring 6.
@HolyRamanRajya
@HolyRamanRajya Жыл бұрын
The intermediary one to many thing you talk about is frustrating if you are coming from SQL syntax. I have grown to quite like it actually that I actually detest SQL Joins now. As a F# regular I prefer that approach a lot. MS devs have been sharing the similar sentiments on the EF repo all these years refusing to make it easier but seems like they are going to provide abstractions for sql regulars soon. .NET7 has really amped the performance of Hashsets too and the results shows on EF DBSet Collection.
@theyreMineralsMarie
@theyreMineralsMarie Жыл бұрын
Just because something can't be learned in an afternoon doesn't mean it is flawed. My team uses Spring security extensively with JWT's and user roles/permissions that are integrated into Okta auth server and our in-house IAM platform. It all works great.
@lucasmontec
@lucasmontec Жыл бұрын
You should give this another go with more time. Experience at least creating a Cron worker thread...
@VincentFree
@VincentFree Жыл бұрын
I've been a java dev but I never liked spring. Say clear if you can. I've used better things on the JVM for web development like vertx
@Beetle_in_the_Anthill
@Beetle_in_the_Anthill Жыл бұрын
Spring is really powerful but it is very huge. But for big enterprise apps it's one of the best variants
@OzzyTheGiant
@OzzyTheGiant Жыл бұрын
What exactly makes it Enterprise? I never quite understood how that sets it apart from other frameworks in any other language? If it's the feature set or the speed of development (which is a bit questionable), by that logic, I would think Django or Laravel would be just as suitable for enterprise work.
@Beetle_in_the_Anthill
@Beetle_in_the_Anthill Жыл бұрын
@@OzzyTheGiantEnterprise projects are big projects especially for automatization big companies. It's not just for default people it's to companies
@Beetle_in_the_Anthill
@Beetle_in_the_Anthill Жыл бұрын
@@OzzyTheGiant sometimes it uses for default projects but it is less popular variant.
@Beetle_in_the_Anthill
@Beetle_in_the_Anthill Жыл бұрын
@@OzzyTheGiant OOP Concept is not about speed it is about architecture. It makes to easier update projects. And it makes it cheaper to work with it
@noname78520
@noname78520 Жыл бұрын
From the init of my developer experience I worked mostly on java and i learned dotnet 6 this year... dude i'm never wan't to back to use java.. the difference is huge.. in every single aspect, asp net and entity core are waaay better than java + spring or another huge rare framework of java
@noname78520
@noname78520 Жыл бұрын
Not only at the framework level.. java is also much more complex in his underlying arquitecture.. i mean.. just read about.. servlets.. servlets containers.. war.. jar.. JPA.. hibernate.. application server.. Java EE (now Jakarta EE) there are millon ways of doing the same thing but always in a kind of complex way
@alexlo5655
@alexlo5655 Жыл бұрын
Agree.
@jvminhell
@jvminhell Жыл бұрын
@Enzo Núñez what are u talking about? Those topics are easy maybe you can understand them but that is not the spring fault.
@HolyRamanRajya
@HolyRamanRajya Жыл бұрын
@@noname78520 Curious How does Java implement real first order functions? Through Functional interface/delegates like dotnet framework, or the way dotnet core implements.
@sudarshanshah2243
@sudarshanshah2243 6 ай бұрын
Java is love. Spring Boot is expression of it in best of sense. Everything is easy to configure and conventions are easy. Anything can be integrated with it with ease and seamlessly. I am proud to be a Java Spring Boot developer. It's breeze to do development with Spring!
@Photoshopper2010
@Photoshopper2010 5 ай бұрын
easy to configure? Are you joking? it's a nightmare and their documentation also sucks
@quachhengtony7651
@quachhengtony7651 Жыл бұрын
i like my migrations thank you very much
@ethannr1
@ethannr1 Жыл бұрын
I get the vibe you just downloaded intellij and hit record
@RawCoding
@RawCoding Жыл бұрын
I’ve hit record first )
@coffee22able
@coffee22able Жыл бұрын
Actually, I think EFCore is much better. - I don't think these magic queries will be suitable for complex real scenarios. - I like the idea of migrations, I need to know how my class chnges will be translated, like if I rename a property will it drop the column and create a new one or it will rename the column. - many to many is much cleaner in EFCore. - The Generics in java is just converting to objects under the hood, the language design is worse than C#.
@hanzofuma
@hanzofuma Жыл бұрын
Jpa has other features for complex queries like Specifications and Projections, simple queries can be done so easily like if you want to create a function that fetches a user by specific criteria let's say name, or email and age between you go to the user repo interface and add a declaration of a method: User findOneByNameLikeOrEmailEqualAndAgeBetween(String name, String email, int minAge, int maxAge) Now all you have to do is calling the method. I agree that they should have a migration system but it looks like they want to keep the framework un opinionated but there is external tools like liquibase to manage migrations. Relations require one annotation the example he found wanted to customize the relations
@Do6po
@Do6po Жыл бұрын
try to use php laravel - you will love this framework)
@RawCoding
@RawCoding Жыл бұрын
we'll see PHP might be quite the step for me :P
@doniyor7370
@doniyor7370 10 ай бұрын
Spring JPA not having migrations is just that… no migrations. Spring just creates the initial schema for you, and nothing else. For actual production migrations you have to use something like Liquibase or Flyway which is worse that EF migrations.
@sebastianbejarano350
@sebastianbejarano350 Жыл бұрын
"The fuck is a bean" LOL Hahhahahahha I was like that when I first learned spring
@nerminkarapandzic5176
@nerminkarapandzic5176 Жыл бұрын
You have probably chosen the hardest part, Spring security is very powerful but also really complex (needlessly imo) and the docs/content you can find online honestly mostly sucks.
@JohnSmith-ob9gr
@JohnSmith-ob9gr Жыл бұрын
how do you recommend someone learn Security?
@nerminkarapandzic5176
@nerminkarapandzic5176 Жыл бұрын
@@JohnSmith-ob9gr I learned it by literally working with it and then placing breakpoints in the source code and following the execution. Official library docs is good to understand the overall architecture but it fails with providing useful examples, and what I hate about it is there's so much outdated stuff in there and also lots of examples with xml configuration which I think nobody uses anymore... Also if you're new to the ecosystem it isn't even easy to find the official docs, there's so much clutter on the spring docs website it's crazy, not to even mention the horrible ux and ui...
@justSomeUserOnYT
@justSomeUserOnYT Жыл бұрын
​@@nerminkarapandzic5176 I wanna say this is a symptom of not enough educated developers and too many developers that are in over their heads. You have to play around with it and actively see whats going on to learn. That is the case for everything. There doesn't exist a single language or framework that you can watch a single udemy course on and fully comprehend what is going on. At best, you learn terminology and can implement slightly faster. I think we are in a weird point with software engineering where there are a lot of people that simply get by via googling everything and never fully understanding what exactly they are copy-pasting.
@nerminkarapandzic5176
@nerminkarapandzic5176 Жыл бұрын
@@justSomeUserOnYT I must disagree, there are other libraries in different ecosystems that do the same thing but are much easier to follow and understand and this is my only complaint. This mostly comes down to the documentation but imo spring security also over complicates everything.
@Dev-Siri
@Dev-Siri Жыл бұрын
as someone who is recently getting into C# .NET Core, Java looks like hell.
@sifisodennis3344
@sifisodennis3344 5 ай бұрын
🤣 I must say i agree with you 🤣
@akindurosegun2459
@akindurosegun2459 Жыл бұрын
It's not really magic... so the idea of SpringBoot is to Bootstrap your development process, but if you really need to do the most niche stuff, there are tons and tons of configurations you can do, I'm talking XML or Configuration classes, it uses the builder and Factory patterns heavily for this. Great video bro
@carlosboyanosky8044
@carlosboyanosky8044 Жыл бұрын
Funny watch you kinda lost while doing something new haha... This is how I feel in most of your videos trying to following them xD
@AlizerLeHaxor
@AlizerLeHaxor Жыл бұрын
as a c# programmer java is like a huge downgrade comparing asp and springboot
@andrejladislavsmith
@andrejladislavsmith Жыл бұрын
You should try String in Kotlin
@zvado
@zvado Жыл бұрын
Im a dotnet dev but im transition to java in 3-4 will look for java job. Higher pay more jobs.
@RawCoding
@RawCoding Жыл бұрын
good luck!
@RustedCroaker
@RustedCroaker Жыл бұрын
Welcome to the bright side!
@HolyRamanRajya
@HolyRamanRajya Жыл бұрын
Learn COBOL
@dennisdepper2388
@dennisdepper2388 Жыл бұрын
As a Spring developer I can confirm that Spring Security is by far the worst Spring project. But good job anyway!
@trevortrevose9124
@trevortrevose9124 Жыл бұрын
Have you tried using laravel 😉
@RawCoding
@RawCoding Жыл бұрын
nope
@humanardaki7911
@humanardaki7911 Жыл бұрын
"There are only two kinds of languages: the ones people complain about and the ones nobody uses". -Bjarne Stroustrup maybe we can extend this to frameworks as well ;)
@JoseAlvarez-dl3hm
@JoseAlvarez-dl3hm 7 ай бұрын
well, .NET is actually heavily used on the enterprise side
@alansmith4655
@alansmith4655 Жыл бұрын
Spring is awesome.
@user-ex9xg3ng5q
@user-ex9xg3ng5q Жыл бұрын
.netcore is awesome
@HappyHorge
@HappyHorge Жыл бұрын
You should definitely try out Nest JS 😄
@yohanespradono5224
@yohanespradono5224 Жыл бұрын
Why?
@dan73402
@dan73402 8 ай бұрын
​@@yohanespradono5224 it a great backend framework
@lasgegas
@lasgegas Жыл бұрын
Java is my starter language. And then got job as dotnet dev. It's so much easier and I can understand my code better. Goodbye to annotation, goodbye to application.properties and goodbye to ResponseEntity. One thing I miss is date data type
@mihailmojsoski4202
@mihailmojsoski4202 Жыл бұрын
hello to `unsafe` and `unmanaged` lmao (try using them, it's fun)
@yohanespradono5224
@yohanespradono5224 Жыл бұрын
​@@mihailmojsoski4202 care to explain?im a .net and spring boot newbie
@mihailmojsoski4202
@mihailmojsoski4202 Жыл бұрын
@@yohanespradono5224 it's a feature that's impossible to imagine in Java, it lets you work with pointers like you are using C
@dleonardo3238
@dleonardo3238 5 ай бұрын
Try Kotlin spring and save a lot of headaches
@clearlyunwell
@clearlyunwell Жыл бұрын
👍🏽
@matthewrossee
@matthewrossee 2 ай бұрын
Even fucking ruby on rails has less magic than spring.
@WoodmanFFM
@WoodmanFFM Жыл бұрын
JPARepositories are nice - mostly. You can define a lot of simple queries by simply adding a method to the interface like "findByUsername(String username)" and Boom you can search for the field "username" in your table. And yes, "findByUsernameAndZipcodeAndFavoritecolor(String username, int zipcode, MyOwnColorType favoritecolor);" will work as well... The automatic migrations are where it gets difficult - because it doesn't automagically catch ALL things it should migrate. E.g. you have a field mapped to a varchar(30) and want that to be a varchar(50) - it won't migrate automatically and you'll end up writing your own migration scripts again.
@bjarne9700
@bjarne9700 Жыл бұрын
when youre at the point of needing to migrate a live system you hopefully already use something like flyway to create the tables or at least migrate them. But then you could just use a NoSQL DB and dont need to migrate at database level at all.
@WoodmanFFM
@WoodmanFFM Жыл бұрын
@@bjarne9700 Sure, all correct. However, Raw Coding was so happy about the automatic schema creation and updating stuff that I thought I should point out where the limits are.
@RawCoding
@RawCoding Жыл бұрын
I do by the end mention that magic tends to get in the way when you’re doing something complicated. So though it might be nice at start by the end it could be a disaster
@bjarne9700
@bjarne9700 Жыл бұрын
@@RawCoding yes and no. Surely there is a lot of magic and as a developer you should know how a framework works. But there is a reason that spring is used so much in the enterprise field. It’s well structured, has great documentation, has a huge community, long term support and spring projects are really nice to maintain.
@E_free90
@E_free90 7 ай бұрын
Liquibase is your friend ;)
@dromedda6810
@dromedda6810 Жыл бұрын
me being a c programmer: dafuq is a factory ?
@nathansnow
@nathansnow Жыл бұрын
Hahaha I think you'll find the single liner login is actually a zero liner login... If you simply add the spring security dependency to the project and then run it, spring security gives you a login page by default, and there's even developer login credentials logged to the console when the app starts. Adding users, user details services, roles, and authorities is more involved though. Also the method you wrote to find a student by id, was actually already defined for you because it's part of the JpaRepository you extended. JpaRepository has a bunch of predefined methods you can use including save, saveAll, findById, delete, deleteById etc.... Also, you can abstract more boilerplate code with tools such as Lombok, which will take care of all your getters, setters, constructors and tons more, and also JpaBuddy that will help create and configure your entity classes and repositories etc. I think with a little more context is worthy of a second opinion don't you? 😉
@IssaFram
@IssaFram Жыл бұрын
I don't understand why anyone would ever use EF migrations. Great for simple apps but can always be a disaster for enterprise applications. Use actual SQL scripts for deployment. And all the model classes can be generated easily.
@nicholasferrara8028
@nicholasferrara8028 7 ай бұрын
Should have tried kotlin with spring boot
@IssaFram
@IssaFram Жыл бұрын
Java using property injection seems dirty. Construction injection ftw
@DWS-123
@DWS-123 Жыл бұрын
From my view, I think EF Core is better compared to Spring JPA. EF Core has more transparent flow for you to see, but Spring JPA just gives you magic and you don't understand the flow why it works and why it does not work. Magic is very troublesome for developer to troubleshoot in real life scenario where you have to pray hoping the code magic works for your entire development journey.
@user-we4jg5yy4d
@user-we4jg5yy4d Жыл бұрын
The main problem with JPA and spring overall is that your application tied to the spring ecosystem. In case of JPA it is way harder to segregate domain from the persistence because of the AOP and reflections abuse. It isn't necessary a bad thing, you basically can do anything fast and decently if you know the ecosystem , but in my opinion it isn't the way we should do things.
@haris4527
@haris4527 Жыл бұрын
Зато как классно будет стать спринг сеньйором и зная всякую ошибку писать кучу говнокода избегая её. При этом магия будет помогать писать больше говнокода, а как мы знаем, зачастую, в говнокоде измеряется зарплата!!!!в говнокоде,
@JiriKrakora
@JiriKrakora Жыл бұрын
Well, it's not magic, it's simply convention over configuration approach. But in Spring world, you can use many other ways to handle what you need to handle. You are not sticked to only one way.
@HolyRamanRajya
@HolyRamanRajya Жыл бұрын
How does JPA handle providers? Do individual providers provide their implementation like EF has or does JPA try to support all other providers?
@JiriKrakora
@JiriKrakora Жыл бұрын
@@HolyRamanRajya JPA is just an API. All vendors comply with the contract with their implementation either using JDBC or RDBC drivers.
@rofgar
@rofgar Жыл бұрын
Yeah, Java dev 9 years of experience here. I agree with you completely, Spring sucks. The funny part is, that there are a lot of less known frameworks that are way more intuitive and easy to use.
@adamc1694
@adamc1694 Жыл бұрын
Tapestry + Cayenne, basically a WebObjects clone
@bobka436
@bobka436 Жыл бұрын
If after 9 years you think that spring is sucks, I have bad news for you, because looks like after 9 years you are still sucks…
@adamc1694
@adamc1694 Жыл бұрын
@@bobka436 He said "Java dev 9 years", no mention must be all on Spring. Nevertheless, there are "a lot of less known frameworks that are way more intuitive and easy to use" is true.
@bobka436
@bobka436 Жыл бұрын
@@adamc1694 I didn’t quote about more intuitive and better. Just about sucks. Spring framework is masterpiece in framework’s world. Yes, it has issues, but current dotnet core/5/6/7 took a lot of solutions from Spring / Spring Boot( or maybe other framework but Spring also already has it, like embedded DI, embedded server, fat jar/all in one file, separate modules etc)
@adamc1694
@adamc1694 Жыл бұрын
@@bobka436 "Spring framework is masterpiece in framework’s world." Please, how many frameworks you have gone through? Spring is finally on the right track. However it is still a few generations behind and without a Enterprise behind, it will never have the resources to advance. M$ is well known for being a copycat. No one will argue for that. But as of who is copying from whom, please again. You have yet to seen what WebObjects accomplished some 30 years ago. In certain areas like the ORM, as of today still frameworks can come remotely close to it.
@ankeshkapil3129
@ankeshkapil3129 Жыл бұрын
The problem with java is a lot of big corporates are using it in production and thats why it cant introduce any major breaking changes
@HolyRamanRajya
@HolyRamanRajya Жыл бұрын
Lol its just Oracle and their lazy improvement cycle. Dotnet made transition from .NET framework to .NET Core quite easy, even provides tools for that. Native First Order Functions in dotnet Core is a mad improvement from the archaic 90s era OOPs. Even today I see issue with OracleDB not able to produce consistent results from ANSI JOINS, devs who use plsql still use ugly cursors and (+) syntax refusing to think beyond. Oracle is a bogus company that only cares about making bank and marketing. DeWitt Clause will forever showcase Oracle's practices.
@adamc1694
@adamc1694 Жыл бұрын
No, that is not the real problem. SOLID, O stands for open-closed principle, Open for extension closed for modification, so the real problem is J2EE, Struct, Spring inherited from a bad design from the very beginning.
@matstark776
@matstark776 Жыл бұрын
I think one of the most problems when you're beginning to learn Spring, maven and other things related to Java it's the documentation, sometimes don't explain the concepts very well and provokes a slow learning. Nice video!
@ZettaiKatsu2013
@ZettaiKatsu2013 Жыл бұрын
I have no idea what you're talking about, the documentation is flawless (I am being ironical).
@SXsoft99
@SXsoft99 Жыл бұрын
meanwhile PHP Laravel, you just run a console command and it generates the entire login scafolding, be it in vanila form, react, vue, etc :))
@adamc1694
@adamc1694 Жыл бұрын
That template scaffolding, Python Jango has it, DotnetCore has it and VisualStudio even has GUI just a check box. And if using Azure service, OAuth is already there.
@SXsoft99
@SXsoft99 Жыл бұрын
@@adamc1694 well spring doesnt have it, and a lot of JS frameworks don't as well
@Hitokiri0010
@Hitokiri0010 Жыл бұрын
Jaja let’s not do anything stressful and he goes with spring
@RawCoding
@RawCoding Жыл бұрын
No me gusta
@someoneWhoSpeaksAbout
@someoneWhoSpeaksAbout Жыл бұрын
C'mon, the whole enterprise is based on spring.
@eddyhanderson6916
@eddyhanderson6916 Жыл бұрын
I think Spring team should think better about the way they give name to things. That's not intuitive. @AutoWired to indicate injections; @Bean to indicate wherever that can be Injected; WTF
@jonathanrosado5818
@jonathanrosado5818 Жыл бұрын
It’s a pun because the language is Java, and the Java island makes great coffee, and in order to make coffee you need… beans 🥲
@midoevil7
@midoevil7 Жыл бұрын
As i remember, you can use @Inject instead of @Autowired, @Bean is called that for historical reasons, as the term java-bean was already established long ago to represent managed classes , But practically we usually use more clear annotations like @Controller, @Service, @Repository
@eddyhanderson6916
@eddyhanderson6916 Жыл бұрын
Yes, much better.
@YidingHe
@YidingHe Жыл бұрын
Noted: stay away from Spring Security.
@hstivggfghyhgfg8359
@hstivggfghyhgfg8359 Жыл бұрын
Man what the fuck it took me minimum of 40 hours to do all of that and 99% of time spent debugging and configuring. how you did it in 20 minutes
@RawCoding
@RawCoding Жыл бұрын
Video magic it was more like 2-3 hours if I remember correctly
@birkheadc
@birkheadc Жыл бұрын
Well I'm only 20 seconds into the video but I already spotted your first mistake. Really starting off on the wrong foot with your choice of drink when working in Java.
@RawCoding
@RawCoding Жыл бұрын
Cup of tea is for you, cup of Java Lava for me ))
@Vortex-gz8se
@Vortex-gz8se Жыл бұрын
Everyone here in the comments is mentioning they can't imagine using the auto generated repo queries for complex queries and that is absolutely correct. You aren't supposed to. The auto-generated queries are only for getting entities for updating. For complex and/or read-only queries you write JPQL (Java Persistence Query Language) which looks very much like SQL. You can also just write native SQL. You do both by using the @Query annotation, in the case of native sql you add a "nativeQuery = true" property to the Query annotation along with your query.
@andreasmewald2439
@andreasmewald2439 Жыл бұрын
My mind checked out at 4:18 😅😅😅
@RawCoding
@RawCoding Жыл бұрын
😂
@shaikh.quadeer
@shaikh.quadeer Жыл бұрын
i can write backend with mysql in less than 20 min in spring boot crud app
@mihailmojsoski4202
@mihailmojsoski4202 Жыл бұрын
i can write a "backend" with postgresql and nginx
@RawCoding
@RawCoding Жыл бұрын
I write "backend with mysql" in like 5 seconds using pen and paper, 3 seconds using the keyboard 💪
@temptrue3322
@temptrue3322 Жыл бұрын
thought this was adin ross
@RawCoding
@RawCoding Жыл бұрын
Close enough
@Van4kk
@Van4kk Жыл бұрын
Try Laravel bruv, this is the real one terminal line authentication ))
@spellskreenful
@spellskreenful Жыл бұрын
if u complain about magic, try Laravel xD
@kobibr9362
@kobibr9362 Жыл бұрын
You need that xcsrf token fo each request. You get it from the previous request and append it to the next one. And why is everyone so mad at Spring security? Show me you better, jerry rigged version of security and I will ripe it out and in like it was never there. As a consultant who move every year to a new company, I have seen some criminal security on applications because people thought that Spring security was complex and they would be better with there own simple security. To make it worse people take it at heart when you find these security issues and see you as trouble maker. They feel like you are forcing them to use Spring security. I dont force them, I tell them keep the jerry riggers force but make it right. If there is any security issue I am going find it. They always abandon simplification in favor of Spring security once they understand how a request dispatcher can fuck you up.
@orhancekic_
@orhancekic_ Жыл бұрын
you are high on video, aren't you?
@RawCoding
@RawCoding Жыл бұрын
high for life
@rizaanjappie
@rizaanjappie Жыл бұрын
A real world highly scalable apps will need custom tweaking. Dotnet wins
Жыл бұрын
I have 13 years of experience with Java and skill kept using it in my company but one word to describe Java is "Suck". I prefer C# with asp core rather than Java Spring and Kotlin for android rather than Java.
@konodioda8689
@konodioda8689 Жыл бұрын
why not just use kotlin spring?
Жыл бұрын
@@konodioda8689 because the client doesnt agree :D
@RustedCroaker
@RustedCroaker Жыл бұрын
I see Microsoft has gone wild on paid comments recently
Жыл бұрын
@@RustedCroaker could you help me to claim the money from them ☺️☺️☺️
@RustedCroaker
@RustedCroaker Жыл бұрын
@ Go pray your dark master :-)
@nempk1817
@nempk1817 Жыл бұрын
(java from microsoft) dev trying java, cool i guess.
@curtisw0234
@curtisw0234 Жыл бұрын
don't be so quick to praise JPA... not a single migration? that will turn into a problem if you have some foresight
@Rogueixpresents
@Rogueixpresents Жыл бұрын
Dude I like Java as a language but it’s tooling feels like from 1950s
@RustedCroaker
@RustedCroaker Жыл бұрын
Dude really? Name a better IDE overall then IntelliJ IDIA for any given language or gtfo
@arghyamitra3281
@arghyamitra3281 Жыл бұрын
Bro just a suggestion to u , first learn in depth then compare with any framework, if u just copy pasting code from places u will find everything difficult.
@HolyRamanRajya
@HolyRamanRajya Жыл бұрын
I literally did the same set of stuff to learn c# and MERN. Its just Java that has this problem.
@lucasmontec
@lucasmontec Жыл бұрын
.net core doesn't offer not even 20% of what spring does.
@ram0973
@ram0973 Жыл бұрын
for example?
@phyohtetpaing44
@phyohtetpaing44 Жыл бұрын
Example for memory safety and memory bug .More security venibality than java .
@danhoward7697
@danhoward7697 Жыл бұрын
When are you going to do WPF vs JavaFX? Oh yeah you won't because you'll understand then how shitty WPF is.
@LukeAvedon
@LukeAvedon Жыл бұрын
ack! WTF @BEAN
@Marc1920x1080p
@Marc1920x1080p Жыл бұрын
compared to VS all java-like IDEs are looking so ugly...
@RawCoding
@RawCoding Жыл бұрын
JetBrains makes the best IDE's out there, VS is a pile of shit
@CharlesBurnsPrime
@CharlesBurnsPrime Жыл бұрын
It's not fair to compare a Java technology when you are accustomed to .NET. Start with PHP, Perl, or some other janky system and you will be far more impressed with a Java technology.
@crisyglo
@crisyglo Жыл бұрын
Yeah sure .Net "developer" , there's not such thing
Java is mounting a huge comeback
3:40
Fireship
Рет қаралды 1,1 МЛН
Java 21 Is Good?! | Prime Reacts
27:08
ThePrimeTime
Рет қаралды 224 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 57 МЛН
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 18 МЛН
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 42 МЛН
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 111 М.
#5 What is Spring Boot?
12:12
Telusko
Рет қаралды 43 М.
#Section-04 'if'  Statement / Python Full Course / Code With Pirple
30:36
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,5 МЛН
What is the Java Job delusion?
12:23
Stefan Mischook
Рет қаралды 112 М.
Every single feature added in C# 11
27:07
Nick Chapsas
Рет қаралды 110 М.
What you should know about Threads in .NET
14:52
Raw Coding
Рет қаралды 7 М.
Is C# Better than Java?
18:41
Gavin Lon
Рет қаралды 13 М.
10 Spring and Spring Boot Common Mistakes You Need To STOP
15:49
Amigoscode
Рет қаралды 144 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 57 МЛН