Комментарии:
"the fuck is a bean"
same bro, same
"Bean, what the fuck is a bean" Literally thought what you said out lmao.
Ответить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.
Ответить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!
Ответитьas someone who is recently getting into C# .NET Core, Java looks like hell.
Ответитьi like my migrations thank you very much
Ответитьdon't be so quick to praise JPA... not a single migration? that will turn into a problem if you have some foresight
ОтветитьHow can one expect that there will be no learning curve?
Ответить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
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.
ОтветитьInsightful! Thanks for sharing your insights.
Could you do a similar video on NestJS?
A real world highly scalable apps will need custom tweaking. Dotnet wins
ОтветитьThe word bean just puts me off.
ОтветитьI decided to keep watching for some weird reason lmao. This vid is so funny lmfao
Dude doesn't know what dependency injection is?
He did something that's wrong, then got the correct thing to work, and is surprised it works?
The project has no structure, bestie just copied/pasted code with some minor changes and thinks it'll work as expected. That's what I did in my first year
Bro didn't know what a Bean is. Did he google it? Nah, why should he?
compared to VS all java-like IDEs are looking so ugly...
Ответить"I don't know what kind of teleportation going on here" cracked me up bad LOL🤣🤣
Ответить👍🏽
ОтветитьI'll take java and spring any day over that Microsoft crap.
Ответитьmagic is not good, it hinders programming comprehension
ОтветитьJava using property injection seems dirty. Construction injection ftw
Ответить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.
Ответитьuse spring starter to add postgres, it will add the correct driver
Ответить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.
Ответитьthought this was adin ross
Ответить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!
ОтветитьMan you're good! That was some quality content, thx
Ответить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? 😉
requestMatchers("/secret").permitAll() - this should be pretty obvious why it's not asking for authentication... anyRequest() matches all requests which are not matched explicitly and .authenticated() means they require authentication.
ОтветитьDon't have experience with Java & Spring and immediately starts out with Spring Security, that's brave my man.
Ответить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.
Ответить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.
Ответитьme being a c programmer: dafuq is a factory ?
ОтветитьYou should definitely try out Nest JS 😄
Ответить"The fuck is a bean" LOL Hahhahahahha I was like that when I first learned spring
ОтветитьITT person who has years of experience in one framework complains about not knowing how to use an equally huge framework instantly.
ОтветитьPuny mindset. Complains about everything. Not even worthy of being called an engineer.
Ответить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.
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. :)
Well actually it’s very funny to watch, like monkey trying understand how hammer and nails work 😂
Man, you just need to spend some time reading how that works. If you put Java Developer to C# you will see the same helpless behavior
"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 ;)
When are you going to do WPF vs JavaFX? Oh yeah you won't because you'll understand then how shitty WPF is.
ОтветитьSpring is awesome.
ОтветитьYou should try String in Kotlin
Ответить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
Ответить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.
Ответить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.
Ответить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
ОтветитьTry Laravel bruv, this is the real one terminal line authentication ))
Ответить