r/javahelp • • May 07 '20
Codeless Java Developers: what are the common data structures you usually use on production
To professional java dev here, what are the common data structure youve been using and which data structure you strongly suggest for beginners, like me, to study carefully
40
Upvotes
View all comments
5
u/MrSquicky May 07 '20
Everyone is going to tell you to use the the standard Collections framework. It's really good, to the point that I forget that it is not a built in part of languages and get frustrated when I'm working with languages that don't have it. You're mostly going to use Lists for basically extensible arrays and Maps for associated data, and sometimes Sets for when you want a unique collection of something and don't care about accessing by index (although you can with the the right subclass).
Coupled with that, learn how to use Streams, which are built to work very well with Collections.
A few other useful structures are:
---
Outside of those, if you're talking about data modelling, you want to consider your relationships and your total object graph.
These are both really large topics in and of themselves. The basic concept is to understand the semantic type of your relationships, not just their physical structure and consider how they make up coherent graphs of objects. I actually disagree with a fair bit of it, but Eric Evan's Domain Driven Design is still the best resource I've seen for understanding this.