Skip to content

Real World Lean Java Practices, Patterns, Hacks, and Workarounds

Adam Bin shares lean Java practices, patterns, and hacks from his 25+ years experience, focusing on productivity, cloud, and enterprise challenges.

Ask about this video. Answers come from its transcript only — with the timestamp, so you can check them.

Generated from the transcript and can be wrong — check the timestamp.

Key Takeaways

  • Java remains highly efficient and suitable for cloud-native applications.
  • Avoid unnecessary architectural complexity and cargo cult coding patterns.
  • Focus on business value and automation rather than technology trends.
  • Use minimal layers and proper package structuring for cleaner codebases.
  • Testing should be driven by code complexity, not arbitrary rules.

What the video covers

  • Adam Bin presents at Java One about lean Java practices, emphasizing code over slides.
  • He critiques excessive layering and cargo cult programming in enterprise Java projects.
  • Highlights Java's efficiency, cloud readiness, and backward compatibility.
  • Discusses differences between startups and enterprises, and product vs project mindset.
  • Shares insights on testing, architecture simplification, and avoiding over-engineering.
  • Mentions working with Java since 1997 and using Java 21 LTS in production.
  • Explains importance of focusing on business needs rather than technology hype.
  • Talks about tools like UML, Draw.io, and Java Persistence API for better design.
  • Encourages pragmatic use of packages and minimal layers for maintainability.
  • Addresses common misconceptions about Java being slow or not cloud native.

Answers

Questions about this video

Why does Adam Bin emphasize removing unnecessary layers in Java projects?

Adam highlights that many Java projects have excessive layers and patterns without clear purpose, which reduces productivity. He advocates for minimal layers and proper package use to keep code simple and maintainable.

Is Java suitable for cloud-native applications according to the video?

Yes, Adam argues that Java is efficient, cloud-ready, and backward compatible, making it a strong choice for cloud-native development, especially with recent versions like Java 21.

What is the difference between enterprise and startup projects as explained in the talk?

Enterprise projects often involve bureaucracy and esoteric processes, while startups focus more on agility. Adam notes that large enterprises sometimes operate like startups but face more complexity.

Full Transcript — Download SRT & Markdown

00:00
Speaker A
Oh, perfect. So, my name is Adam Bin, and welcome to Java One.
00:14
Speaker A
San Francisco. Uh I think it's my 10th or something like this. And uh this one is actually great and I surprised that so many are very good. So many developers. And what's also cool, maybe 10 years ago, I delivered a similar
00:29
Speaker A
Who is the first time here? First Java One? That’s incredible.
00:41
Speaker A
I'm doing. So I deleted all the slides is more code. So it's a good news, right? Uh so um but um interestingly what I hate to speak about the topic twice. So there is another presentation from J focus. It was like a few weeks
00:55
Speaker A
And this is my first here. All other Java Ones were in San Francisco.
01:03
Speaker A
This is my hack actually. I I submit something and talk about something different. So uh um so uh now okay um uh PDF exactly. So um what I'm talking about today is actually common sense but I'm surprised that if
01:22
Speaker A
I think it’s my 10th or something like this.
01:38
Speaker A
very famous for that because there were lots of patterns layers and no one knew why and we did it until Python nojs and everything else happened and they don't do it and therefore they are a little bit more productive than we are and and
01:51
Speaker A
And this one is actually great, and I’m surprised that so many are very good, so many developers.
02:02
Speaker A
about basically so it is obvious but not that obvious because I always still have to fight with architects and projects so I'm a freelancer I'm working with Java since 1997 uh most in projects back end I do Java
02:14
Speaker A
And what’s also cool, maybe 10 years ago, I delivered a similar session, and the idea was to show you the div, but because you never saw my sessions, it was pointless.
02:28
Speaker A
the Javas are not that secure. We need the recent patches and otherwise we you know maybe someone could do something to us and then we get Java 21. Whether it is true or not I don't care but it's a
02:40
Speaker A
So I got the idea today morning and yesterday to refactor the entire presentation.
02:52
Speaker A
project on serverless uh we had uh there was no Java 17 even so we create our own runtime and we knew that it will come out. So we worked with Java 17 the project went to production we got Java
03:04
Speaker A
So now it’s not like it should not be so what I’m doing.
03:10
Speaker A
Uh someone asked, "Hey, Ahex, uh how the company is going?" There's no company, just me. I'm a freelancer. And immediately after the conference, I I registered Ehex Industries. If you go there, you'll see my GitHub and and and
03:21
Speaker A
So I deleted all the slides; it’s more code.
03:33
Speaker A
productive. This is mainly the reason, right? and uh and uh Oracle does a really great job moving Java for forward and in and in big project Java is actually very popular because it is backwards compatible. So this is not
03:46
Speaker A
So it’s good news, right?
04:00
Speaker A
20 or even 10. Right? This would this will be interesting to know. Okay, there's a podcast with some stuff which is relevant. For instance, the boundary control entity. What I will show you very soon is my way to
04:12
Speaker A
But interestingly, what I hate is to speak about the topic twice.
04:26
Speaker A
introduced boundary control entity wrote some books about that since then I use his stuff and don't have to just justify why it is like it is read his book and you will know right so but um the cool
04:37
Speaker A
So there is another presentation from J Focus. It was like a few weeks ago with the same title, but the content you will see is different.
04:48
Speaker A
compatible with my idea otherwise it I wouldn't publish the podcast of course but um it's actually a nice one because um yeah I think he's 70 or 80 and he was one of the creators of UML you know what
04:59
Speaker A
So there were just slides, mostly code.
05:12
Speaker A
was really okay so Now, any questions left? Uh, first Monday of the month. Uh, I I just you can ask me whatever you like. Similar to here. Oh, and this one was accident. I don't have time to explain why, but there's 850 or maybe
05:25
Speaker A
So this is actually cool.
05:38
Speaker A
sometimes boring. So, this is actually a cool thing, you know, to to to the code.
05:42
Speaker A
So we have one title.
05:52
Speaker A
premise um so and uh what I have to hear over and over again Java is too slow or not cloud native whatever it means uh truth is that Java is actually perfect so Java is number five energy efficiency
06:05
Speaker A
This is my hack, actually. I submit something and talk about something different.
06:20
Speaker A
money you have to learn other right or stick with Java. So this is why I don't learn other right now. Uh there's also no other one I think right? So um and uh but what was the alternative? Python
06:33
Speaker A
So now, okay, PDF exactly.
06:48
Speaker A
right we will have to pay 35 times more than Java in worst case so and this is why I do Java in the cloud because the first time in the history we can convince management is good for business
06:59
Speaker A
So what I’m talking about today is actually common sense, but I’m surprised that if someone says that it improves the situation, right?
07:11
Speaker A
faster a bit and see as well the problem with rust it is really hard to learn for business applications and you won't find developers and what I like about Java is obvious if you look at the source code I
07:22
Speaker A
And what I saw in projects, in enterprise projects, you know what cargo cult is? Actually, this is people doing something and no one knows why.
07:34
Speaker A
don't see any maybe it's slow that is not even on the page [Laughter] I think it's Java style because cotlin is not there. Yeah. Uh I don't know. I I'm just I'm just happy that I found something when Java is on top. So this
07:52
Speaker A
And Java was actually very famous for that because there were lots of patterns, layers, and no one knew why we did it until Python, Node.js, and everything else happened, and they don’t do it, and therefore they are a little bit more productive than we are.
08:06
Speaker A
even five years ago it was very strict. There was no hard architectures whatever and if something doesn't work I came in I delete lot of stuff and it's fine 10 years ago it would be fines and no meetings and and managers and whatever
08:20
Speaker A
And then my point was, years ago, we could also delete the stuff, right?
08:35
Speaker A
about dows DTO's and whatever I forget that anyway about them but if you know the names don't use them for structuring if you would structure the Java one here right so what we will have I would expect packages I use packages Java with
08:49
Speaker A
We don’t have to write 20 layers to see a button on the screen. Maybe one class is enough.
09:05
Speaker A
what is going on. So this is actually what you learn at school, right? Use packages as a package and and what I see in projects is crazy stuff like uh service, DTO's, VOS, meas foundation, models, whatever sounds good
09:22
Speaker A
And this is the talk about basically.
09:37
Speaker A
asked me this week what is enterprise? For me enterprise means uh larger projects with some bureaucracy and uh and and and uh esoteric stuff. This is enterprise. But if uh in in large enterprises we also do kind of a startup
09:52
Speaker A
So it is obvious but not that obvious because I always still have to fight with architects and projects.
10:03
Speaker A
startups and enterprises. Um what's more difference is between a product and project. So in product we spend more time with automation, versioning and uh and really testing and in projects it really depends right any questions. So a domain business first it means
10:21
Speaker A
So I’m a freelancer. I’m working with Java since 1997.
10:30
Speaker A
the use cases. Yeah, what I'm doing instead and they generated CRUT first created update delete for customer orders and they had already know 3,000 Java code uh classes without knowing anything about the system. So I I would say this this we we must not do this
10:47
Speaker A
Most in projects back end, I do Java all the time currently Java 21 everywhere because it’s LTS.
11:01
Speaker A
tools draw io. Uh what is what else we have? All UML magic draw and enterprise architect and vio and uh the um omnigraph on Mac all to support the icon which is actually pretty cool. So the icon is actually who saw already
11:18
Speaker A
How I get Java 21 the first tag or Varound?
11:31
Speaker A
something which communicates with the outside world. And uh this is usually in my projects rest 90% of the time is rest. Control is choice of developer. If something if a class is reusable or more complex you create a control and entity
11:45
Speaker A
If you go to management and say it is not true, maybe you can cut it out later.
12:02
Speaker A
It's similar to MVC and simpler I would say. Okay. Now um about apps. So the problem with consultants is uh NDAs and uh but one really important project for me is my blog because if it's down I get
12:20
Speaker A
But what I say, you know, all the Javas are not that secure.
12:36
Speaker A
okay let's migrate this to a new world. So I did it. It is not this is not an open source project because it's not very pretty. I have to do some strange stuff. But the organization what I did
12:46
Speaker A
We need the recent patches, and otherwise, maybe someone could do something to us.
12:57
Speaker A
like metrics and you see every package has the same structure. So there's RSS control. It means there's no boundary.
13:05
Speaker A
And then we get Java 21.
13:21
Speaker A
developers because this don't make me think right. So if I know the business concept and open and it's done and uh funny stuff or funny uh two years two years two two weeks ago I have to migrate an an an old legacy J2E
13:34
Speaker A
Whether it is true or not, I don’t care, but it’s good for my clients, right?
13:48
Speaker A
it it was supposed to be killed but right now it is good enough to survive maybe and it will run on quark soon. So um so it means you really have to focus on on business and not the technology
13:59
Speaker A
But these are good for my clients, and this is the reason why I do it.
14:09
Speaker A
So we had in J2E HTTP client I don't use it anymore often because I have Java HTTP1 client and and and the more standard the better right pretty cool questions regarding the structure. So the business you mean you see here the top level packages this
14:25
Speaker A
And so we have Java 21 LTS everywhere, right?
14:40
Speaker A
good question um common code maybe I did it here as well is usually here in the root it means for instance the version of the block this is the version is um and configuration they are just on on on
14:53
Speaker A
If the project runs longer, for instance, in one project on serverless, we had no Java 17 even, so we created our own runtime, and we knew that it would come out.
15:08
Speaker A
create package commons or util but if you look inside there is a date operation string operation so what I will do is I will create one package dates strings or time zones or whatever so there is but common utils whatever
15:20
Speaker A
So we worked with Java 17, the project went to production, we got Java 17.
15:33
Speaker A
to do. I will put you know everything to commons. Take a look at Java utils Java util package everything there. Maybe mistake we have to ask Brian Guts actually with good architect question.
15:43
Speaker A
So sometimes we do crazy things, right? LTS.
15:57
Speaker A
other right. Okay cool. Uh very good. So we had this and this is the packages now and every package has boundary control entity. They can call each other and cycles between packages are allowed. So this is otherwise you spend lots of time
16:16
Speaker A
Yeah.
16:29
Speaker A
impossible how they doing this right it's like 90% everything all these all these stats were perfect and I look at the code and they use reflection to hide the dependencies which is inverse right um then use Python is better than right.
16:42
Speaker A
This is the AX Industries.
17:00
Speaker A
timeouts and all the stuff can go wrong lots of Java projects 10 years ago were proud to have 100 microservices I never understood why I mean this is just crazy so if I can I build everything in one
17:13
Speaker A
Someone asked, "Hey, Ahex, how is the company going?"
17:29
Speaker A
function or or exactly. So this lambda has 150 end points. So which is a lot and um 500 classes and it starts in under two seconds. and everyone is happy right? So why we should split the lambda? So I get all the question is not
17:46
Speaker A
There’s no company, just me. I’m a freelancer.
18:00
Speaker A
somehow configurable but if you are lazy so I'll show you what I doing if I'm lazy. So this is here the posts and there should be a post store. So what I'm doing with configuration I say I would like to have I don't know max
18:15
Speaker A
And immediately after the conference, I registered Ahex Industries.
18:27
Speaker A
later um configure it with properties but I try to avoid files and properties. So XML files, YAML files are the worst my perspective but if you like do YAML but I don't get it. So uh application properties or XML or YAML or JSON is
18:45
Speaker A
If you go there, you’ll see my GitHub and Blue Sky or whatever there is.
18:57
Speaker A
hopefully or you should not do it because it's too complex. What do you do instead? Every configuration change we redeploy the entire application. If you do this, it really doesn't matter whether you put something in application properties or for instance in enum. So
19:11
Speaker A
So you want a picture, of course.
19:24
Speaker A
rather change an enum. Okay cool. Yeah. How do you go about like deployment level.
19:35
Speaker A
But I like Java. That’s all.
19:51
Speaker A
names. That's a problem. and uh in the cloud. So we have multi account deployments and every account what we do is we register a domain with the cheap domain with domain of the account is something which is cheap consistently
20:05
Speaker A
Why? Because we don’t have to discuss a lot.
20:18
Speaker A
is is is identical to all accounts. And if you're in the cloud, if you think about this, every account is identical.
20:25
Speaker A
So we pick Java, it’s good enough, and we are productive.
20:39
Speaker A
you have to do this. So there's more work with namespaces, whatever. If you have serverless, nothing to do. So you can have identical identical deployments in all stages. Very good. Thank you. So now I'm more interactive. So I don't
20:51
Speaker A
This is mainly the reason, right?
21:02
Speaker A
Uh yeah, but this is not a best practice to work around. I would like to have identical databases everywhere because we have the chance to do this and this is very cheap. No, it's cheap. It really depends on database. So um maybe this is
21:15
Speaker A
And Oracle does a really great job moving Java forward.
21:26
Speaker A
second it cost you almost nothing and because it scales you get always production experience okay but there's no slides on that so there's the first talk which I don't talk about that so but um my my I try to have production and development
21:43
Speaker A
And in big projects, Java is actually very popular because it is backwards compatible.
21:55
Speaker A
shut shut it down or up but it should behave identical and by the way because now back to Java if you have a Postgress in the cloud or whatever I would like to test with Postgress locally I'm not huge
22:06
Speaker A
So this is not actually true for any other language, I would say, right?
22:26
Speaker A
Uh what what then what I do? Yeah. What I do if I if I get hired uh um I do whatever I I think is good for the clients or necessary to do and we couple the refactoring on every use case
22:39
Speaker A
So maybe there is one, but I don’t think so.
22:52
Speaker A
likes likes or not or I say okay it's not you know what I mean and the most important thing is to be consistently slower which is a big mistake if you are fast at the beginning the management is
23:04
Speaker A
So it will be interesting actually to find out if this is something comparable to Java which remained 30 years stable or 20 or even 10.
23:17
Speaker A
Yeah. And this is what I do at the beginning. We automate CI/CD pipelines everything at the beginning. So we need more time for that. And this is a good stuff for my clients and my client ask me what they are doing. Yeah, we
23:30
Speaker A
Right? This would be interesting to know.
23:48
Speaker A
okay now um we have no time so I'm extreme in the talks right so uh at the beginning unit tests are forbidden why because what happens in Java what we are building I I assume we are building microservices we you call
24:03
Speaker A
Okay, there’s a podcast with some stuff which is relevant.
24:20
Speaker A
okay so what I do instead is from the beginning when you deploy an endpoint like here this is my uh block but is not a good maybe I have um I don't even know I I have these system tests but I have
24:36
Speaker A
For instance, the boundary control entity.
24:50
Speaker A
microser and every microser has to ship with a system test and the system tests in this particular case if I go there this is almost identical module but this module accesses the external system. So this is what I wrote today morning for instance.
25:09
Speaker A
What I will show you very soon is my way to structure applications: boundary, control, entity.
25:15
Speaker A
So this is how the test look like. So I'm injecting the client and I can test my iband which is international bank account number I think. So um so the question is why we doing this? Because in microservices which problems do we
25:28
Speaker A
But the first next hack or next, the first next hack is don’t invent your stuff; try to find a standard so you don’t have to talk about that.
25:42
Speaker A
the problems first and then play with metrics. Okay. So my expectation is from the beginning if you implement an endpoint give me all speakers. The first thing to do is to create a system test which fetches the speakers. Okay. So and if the speakers
26:00
Speaker A
And my hack was Ivar Jacobson from UML introduced boundary control entity, wrote some books about that.
26:16
Speaker A
have the power what I say to developers you are only allowed to test when the um how do you call it the um cyclomatic complexity is higher than three or four what cyclomatic complexity is three means if else else right so it means if
26:32
Speaker A
Since then, I use his stuff and don’t have to just justify why it is like it is.
26:48
Speaker A
older system tests and test again against newer service if I keep them separate also you are forced to get you know your interface and from outside see how it works. If I could put in cork with everything to one
27:04
Speaker A
Read his book and you will know, right?
27:17
Speaker A
added value out of system tests and the cool story is now it's a trick. So this is the a small trick but I think a good one.
27:26
Speaker A
But the cool story is I did it for years, and I was curious whether I did it right.
27:41
Speaker A
other classes here. So the cool story is if I run Maven package on this module, I get a jar which you can deploy to Nexus and I get the best tested microser client for free.
27:54
Speaker A
So I invited him to my podcast to explain what I’m doing.
28:12
Speaker A
have an a small virtual thread or executor service and create some not perfect load but good enough and see whether my system is testing. So we can completely reuse the interfaces for free. Any questions? I will submit once
28:25
Speaker A
And thankfully, he said, "Okay, what you are doing is compatible with my idea."
28:39
Speaker A
manipulation would I always substring or whatever right so I always write unit test for that because it's easier and faster. So you decide whether you write unit test or not. But you write unit test to if you say okay this is complex
28:52
Speaker A
Otherwise, I wouldn’t publish the podcast, of course.
29:03
Speaker A
So how to do that? So you can launch quosco agent and um and it tracks the code coverage. So now the cool stories you run your system test record the code coverage and then you see what was called and what was not called and the
29:18
Speaker A
But it’s actually a nice one because I think he’s 70 or 80, and he was one of the creators of UML.
29:37
Speaker A
test. The systems are triggered in the pipeline and the pipeline looks like uh Maven um Maven package skip test first then unit tests then if we have integration tests then the uh uh application is deployed to production like environment serverless is lambda
29:54
Speaker A
You know what UML is?
30:07
Speaker A
check into common repository and then we have multi-system tests multiple microservices fully automated or performance tests and the performance test for several reasons. So um one reason is I would like to see are the timeouts error whatever and the other reason in the
30:24
Speaker A
Yeah, this is like drawing tools.
30:40
Speaker A
gets whether it was the right architectural choice to pick lambda and not faggate or not kubernetes or asia functions or whatever But it's bundled within that same repository. Yeah, this is the same repository. And if you go um
30:53
Speaker A
If you need some boxes to convince people, you can draw something.
31:03
Speaker A
will not understand why I'm still using RSS or whatever. It's just historical reasons. You're not using test containers. H you're not using test containers. No, no. Caucus has great support with test containers. I don't like them because too much magic behind
31:17
Speaker A
What you draw doesn’t matter, but it looks more professional, right?
31:27
Speaker A
happen everything in the pipeline. I don't care about my machine. So my machine should be almost empty.
31:34
Speaker A
So this is, don’t tell him about that, right?
31:41
Speaker A
Yeah, the other services are hopefully in integration stage and if they're not in worst case we have to write a simulator. So we write a small app and we with all the hacks so it should behave mostly like the external system.
31:54
Speaker A
So he was really okay.
32:06
Speaker A
So we have a token-like service which locks in users creates tests that should be also automated. It's painful but you have to do this from the beginning. Any other questions? Very good. Yeah. In my business object if I
32:19
Speaker A
So now, any questions left?
32:27
Speaker A
Yeah. Uh this test um you can you can unit test it in the in the other module.
32:33
Speaker A
First Monday of the month.
32:45
Speaker A
I name it but this end to end test it changes acceptance test are lots of names so I don't know now moving target everyone renames everything I was also afraid you know before pandemic there were lots of enterprise architects after
32:57
Speaker A
I just, you can ask me whatever you like, similar to here.
33:09
Speaker A
architect then right or what what if this is everyone is solution I take then we can skip solution right so but uh or or someone told to me you are a builder so I don't know I just program program a
33:20
Speaker A
Oh, and this one was accident.
33:33
Speaker A
now so um tests we had persistence okay so what um persistence how to start with persistence I would say it depends because the modern Java is uh is uh way more powerful than 10 years ago right so um if we start with persistence
33:53
Speaker A
I don’t have time to explain why, but there’s 850 or maybe even a thousand Java shorts, like 30 seconds with Java.
34:06
Speaker A
you have to get a feeling so if there actually no I would say you have no idea I would start still with JPA Java persistence API because it's very simple but you have watch what happens and in my uh one of my projects current my
34:19
Speaker A
And why I’m doing this?
34:34
Speaker A
edit value and I think right now you could use JDBC directly before you watch you know any jalle or whatever take a look how easy JDBC is and this is what I did today morning so like today is a boring a little bit
34:50
Speaker A
Because people ask me, "No, Java is hard."
35:05
Speaker A
about reports So, and this is the reporting reports resource, right? And here's account query and the account query is JDBC plane without any external dependencies. So, this is the first shot half an hour hack. I and and this is
35:27
Speaker A
It is really hard to read a file, like really this one-liner.
35:42
Speaker A
understands that in all tutorials JDBC is covered and of course I don't know I I would say is even nice even have some you know some error handling we'll talk about soon. So this is JDBC and this is
35:53
Speaker A
So I record a short, mostly in meetings.
36:11
Speaker A
my projects we will maybe use JDBC because lots of crazy SQL queries. So we can test the queries you know in intelligj copy them over and we are done.
36:21
Speaker A
They are sometimes boring.
36:33
Speaker A
because we could test everything outside and then load it on demand. You know what I mean? Yeah. What's also cool, this is too simple. You can use multi-line strings to generate the queries. You have to a little bit
36:45
Speaker A
So this is actually a cool thing, you know, to the code.
36:53
Speaker A
So we copy JSON over create multi-line string some replacement and so forth. And um we have write Oracle every other day an email when string templates will came out. So because this will solve a lots of problems string templates.
37:07
Speaker A
Okay.
37:20
Speaker A
and you can't use any yeah this is not the entire example is JPA I just wanted to show you how GDPC looks like it's not like you know and this is in project if you we were together in a project and you tell me
37:37
Speaker A
Workshops, the book is old, but this is based on the book and Java and clouds first.
37:48
Speaker A
and then it's my tenable But if you do I doing this because my architect told me this is a cargo cult and no one will know why it has to be so complicated you know. So I would say
37:58
Speaker A
I do Java in the clouds all the time.
38:10
Speaker A
idea and this was maybe not as possible 10 years ago but right now Java is so simple that we can constantly refactor the entire stuff and and it get faster and faster. Very good. Thank you. Okay. U strong um strong opinions
38:25
Speaker A
If we have cloud, if we don’t have cloud, it’s Kubernetes on premise.
38:36
Speaker A
Always. Always. Exactly. I only have a hammer so I only use JPA. Yeah, exactly.
38:43
Speaker A
And what I have to hear over and over again is Java is too slow or not cloud native, whatever it means.
39:00
Speaker A
Oracle JDBC. I will use JDBC API, right? So there is no unnecessary dependency on products. So this unnecessary it's not like 10 years ago it was a no-go. If there was one dependency everyone go went crazy. Right now it's okay we have
39:17
Speaker A
The truth is that Java is actually perfect.
39:33
Speaker A
persistence is file system. Uh the entire block now I migrated from uh what was it? H2 that database hypersonic 2,000 posts to our file system. It works perfectly. I will never have database problems again. And how long that did this this this roller
39:57
Speaker A
So Java is number five in energy efficiency and performance, which means if you, I have to stay here, sorry.
40:14
Speaker A
blob storage the cheapest solution is a hashmap of course if you already know you have complex joints you cannot do this but it is surprising how how much you can achieve if you have a hashmap and the value can be a JSON
40:29
Speaker A
So there’s C, RAS, C++, and ADA, and means Java is a little bit slower than ADA.
40:48
Speaker A
cloud if you get if you run something in the cloud usually You also have to care about that cloud is empty. So you have to do something right now before I will have to set up a postgress in the cloud which is not
41:04
Speaker A
So if you like to save even more money, you have to learn others, right?
41:25
Speaker A
exercising. So it's not easy. It's not like postgress button. You have to do more than that. Okay. And the and it will cost you for Raspberry Pi deployment 500 a month at least with two CPUs and uh Apple Watch RAM. Right. So
41:42
Speaker A
Or stick with Java.
41:57
Speaker A
concerned with the SSD so I'm caching for that reasons but it was fast enough without without caching okay yeah so oh my suggestion is caches are forbidden test the performance first cache test again if no difference remove caches
42:14
Speaker A
So this is why I don’t learn others right now.
42:27
Speaker A
if you remove cache how faster it gets sometimes because the IO for instance it change a lot in in in the cloud the network is crazy fast is even faster than local storage. So most of the decisions are just 20 years old and uh
42:41
Speaker A
There’s also no other one, I think, right?
42:56
Speaker A
cheapest. And by the way, I have to mention cloud because what I see is this is the last slide, lift shift, lift and shift. People are trying to lifting the existing application to the cloud and this becomes so expensive that no one
43:08
Speaker A
But what was the alternative?
43:18
Speaker A
cloud and hope it is going to be better. And what I do I have I explain it to management because management believes that the own data center is nothing and the cloud is everything and they move it to the cloud and everything gets worse.
43:30
Speaker A
Python consumes 35 times more memory and is 35 times less energy efficient than Java.
43:49
Speaker A
exception, web application exception error 500, this exception is automatically mapped to error 500. I'm done. There's no mappers, nothing in between. And um in uh in projects where um where we have to uh uh to um implement a spec specific format. So in
44:09
Speaker A
So it means if you will do something in the cloud with Python, I mean something means for loops or algorithm, not calling a database, something which does something, right?
44:22
Speaker A
ship the the exception error. Okay. Okay. This is the main trick. So if I find exception map as in project so okay there's already a bad sign so we can all good sign we can remove some code okay so this is web application
44:38
Speaker A
We will have to pay 35 times more than Java in the worst case.
44:52
Speaker A
it you know SL4j uh what is this log forj and and and and and millions of Jace but um we don't need anything because everything is already built in.
45:04
Speaker A
So this is why I do Java in the cloud because the first time in history, we can convince management it is good for business and budget.
45:21
Speaker A
don't need SL4j nothing. So it means in my project we just do this and um and uh what I did here hopefully yeah I did it.
45:30
Speaker A
And there is no discussion, also cool, right?
45:45
Speaker A
that if you have you have a Netflix this won't fly but most of the projects serverless especially there is no concurrency actually because uh lambda is started and you are alone right so you could we use system print line
45:58
Speaker A
So this is, if you don’t believe me, there is research.
46:14
Speaker A
the dynamic configuration no more given. Okay, also logging and error handling what we do in projects is with uh there is a link between log levels and exceptions. So we say okay these exceptions are technical they are locked
46:28
Speaker A
There are lots of algorithms, whatever, you can go there.
46:35
Speaker A
One minute. They're crazy. Yeah about your blog or how we can learn more from your I have lots of YouTube lots of blogs two 2,000 uh articles about that but they are older on block but u uh abstractions
46:51
Speaker A
And this is the reason, right?
47:06
Speaker A
use Java modules uh for microservices never I'm already thinking about because I have lots of automation script on my machine to use Java module to organize this but uh not for uh serverside applications never no modules no hi
47:20
Speaker A
Rust would be faster a bit and C as well.
47:34
Speaker A
or or getters on setters I mean never it's forbidden right And um in Java do create snippets. There's a new feature Java Java do snippets in Java do. This is really great. So you can provide examples, right? If you write Java do
47:47
Speaker A
The problem with Rust is it is really hard to learn for business applications, and you won’t find developers.
48:03
Speaker A
to remove everything. So why? because I don't like to play with sbombs and all this stuff. No dependency, no problems, right? Um or you have one dependency. If you have uh spring, there's just spring, nothing else. So in my world is Quus
48:16
Speaker A
And what I like about Java is obvious.
48:27
Speaker A
I would like to have the option to replace Quarkus with Helidon or Micronode for instance.
48:34
Speaker A
If you look at the source code, it is really hard to write that bad code that no one knows what’s going on.
48:49
Speaker A
means and not an standards it means something which is well established and um common sense no branches for instance my project. So uh management want to branch no feature branches. It means we are forced every commit has to run.
49:04
Speaker A
Even if you decompile Java code, still after a while, you will know what’s going on.
49:14
Speaker A
This is this times are over even chrome has just just happens right and um so system test with code coverage uh no problems no patterns. So if you see factory Y if there is no no no no answer
49:26
Speaker A
Okay, everyone agreed so far?
49:44
Speaker A
have to know why we are doing this. If we migrate to the cloud, we have to know what is the goal. If we introduce Kubernetes and not run on Docker, we have to say why are we using Kubernetes?
49:54
Speaker A
Where is Scala?
50:04
Speaker A
right now in my projects is costs are paramount so whatever they try to do which is more expensive is no go cost-driven architecture in other project it doesn't matter so we do different stuff okay uh yeah clear strategy otherwise you get
50:20
Speaker A
I don’t see any.
50:34
Speaker A
never use or install Kafka by myself in the cloud. But on premise, just go for it. Okay. What would you use?
50:44
Speaker A
Maybe it’s slow.
50:57
Speaker A
You are depending on the service. So the next question is how much time time will it take to from there to somewhere else. Thank you a lot. See you next Javon.
Topics:JavaJava OneJava 21Lean JavaEnterprise JavaCloud NativeSoftware ArchitectureJava PatternsCode ProductivityFreelance Java Developer

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries, speaker detection, and unlimited transcriptions.

Or transcribe another YouTube video here →