It's about the structure of your code, not the fundamentals of the language. start with your entities and work out from there.
You ideally need an object oriented language: I don't know how it would work with functional programming, though I've seen it does.