One of the most important things as a software developer is to understand the business. If you don't understand what the users want to do with your software you shouldn't write a single line of code.
OMG ๐ฑ I feel more than honored to be part of this group of amazing people. Thanks to everyone who made this happen. It motivates me even more to share my knowledge and help many developers to be successful with Java.
I like gRPC. We are using it in a new project where the size of the message and performance are essential. Now I start to question why we use REST and not an RPC-style protocol with JSON over HTTP. RPC adds semantics to the interface.
Just spotted it on SO:
return questionsRepository
.findAll()
.stream()
.filter(q->filter(q, embroyo))
.collect(Collectors.toList());
PLEASE learn what the where clause can do for you!
As a developer, going to the office is most often unnecessary. Usually, there is less communication/collaboration in the office than over Slack/Teams, but much more noise and distraction. Why do people still think that developers should work in the same room?
When I started as a software engineer 27 years ago I had direct access to the end-user. Over the years more and more roles were added that do not add value to the solution.
The inconvenience of REST is that you get a 404 error regardless of whether the URL is wrong or the correct URL is called, but the resource does not exist. How do you handle that?
Before you start learning Hibernate or any other O/R-Mapper you should learn SQL and the features of your database. Maybe you will realize that you event don't need O/R-Mapping
Let's not fool ourselves. Small and medium businesses with applications with relatively few users do not have the same scalability requirements as Netflix or Facebook. I can't stress it enough: choose the architecture and platform based on the requirements, not the hype!
Hibernate is not the problem. The problem is how people use it because they don't fully understand how it works. Learn the tools you use! Don't assume how it should work check the manual and/or the source code.
#learnyourtools
A friend told me he doesn't take on projects that use Gradle because there is usually something wrong with the project, as developers using Gradle tend to create a custom build that only a few people understand.
What a day! Just got an email from
@spring_io
: "Congratulations Simon Martinelli! Your talk, Do you really need Hibernate?, has been selected for Spring I/O 2023." I'm so excited to be part of this amazing conference again!
Spring Data JPA Repository's save method returns an entity. You should ALWAYS use that after the save call and not the entity you passed to save because internally EntityManager.merge may be called!
I'm refactoring an Angular/Spring Boot app where front-end and back-end developers didn't talk. You wouldn't believe how much code I can delete on the client side by returning appropriate data in the API.
#Fullstack
#FightForSimplicity
To all the people bashing
#Log4J
and arguing we should use the built-in logging off Java: keep in mind that Log4J is 20 years old. Where was Java logging then?
People on
@StackOverflow
don't read documentation. Most of the time I can help them by posting the right section from the docs. So today I want to thank all documentation writers! I really appreciate your work, that makes my live much easier.
#RTFM
History strikes back. HTMX, and Hotwire to add dynamic behavior are getting a lot of traction lately. Something that Jakarta Faces (JSF) has already had for 15 years! AJAX was introduced in JSF 2.0 in May 2009
If you are using Spring Data and want to know if for some condition a record exists use count instead of find. This may improve the performance because no entities are loaded and no lazy loading can be triggered.
Enterprise Architect, Solution Architect, Business Architect, System Architect, Software Architect, Integration Architect. And who has to do the work - the Software Engineer. We live in a strange industry.
When using JPA/Hibernate, turn on SQL logging and watch it during development. If there are many SQL statements, you have a problem, and you must fix it!
The Hibernate logger is "org.hibernate.SQL"
@sivalabs
Same here. Btw. I was once asked in a job interview what my favorite pattern is. I answered: it's the pattern that best fits the problem. The interviewer didn't like my answer and finally, I didn't get the job.
After some web app framework discussion at
@spring_io
with
@tschuehly
and
@openwms
I gave JSF a try (after about 10 years). What should I say? It just works. What I like about JSF is:
1. Code completion in Java IDEs
2. Component libraries like PrimeFaces
3. No need for HTMX (Ajaxโฆ
Remember: You may not need DDD, Scrum, Microservices, K8S, Kafka, etc. The methods, processes, tools, and technology must follow the requirements. Remember: You may not need DDD, Scrum, Microservices, K8S, Kafka, etc.
๐งต
It's funny and scary at the same time that people think that a modular monolith aka modulith is a complete new approach. This is what we've done 20 years ago...
Be aware that Spring Data's PagingAndSortingRepository findAll method will execute a select plus a count query! If you have a slow query it will take twice the time!
As a small Christmas present, I would like to give you a template for a Vaadin application with jOOQ, PostgreSQL, Testcontainers, and Flyway. It's still a work in progress, but you can check it out on GitHub. Happy Holidays, everyone! ๐
I don't understand the companies that want their employees to come into the office for a few days a week. Some activities work better when employees are in the same room (e.g., workshops or brainstorming sessions), but do they occur several days each week? I don't think so. Also,โฆ
Did you know that you can use
@testcontainers
with
@springboot
while running your app during development? No? Then check out my new video! And donโt forget to subscribe to my channel. More interesting topics will follow soon
I hate these mapping frameworks like MapStruct. They are superfluous if you generate the DTOs directly from the query when reading and have a command model when writing.
Migrating a project to new versions of the dependencies and suddenly, some tests no longer work. Looking at the tests, I can see that they are full of mocks and literally don't test anything. What would you do?
Those frameworks come to my mind, when thinking about web development with Java: Vaadin, GWT, Jakarta Faces (JSF), Spring MVC with Thymelaf, Apache Wicket. What did I miss?
I don't dislike Hibernate - but I definitely dislike how people use it! Stop mapping all possible relationships! You don't need it because you can use JOIN ... ON ... in JPQL: