OOP-Encapsulation issues
As I was refactoring some of our codes, what struck me was the idea of object oriented programming particularly encapsulation.
For example, we have this Customer object which is distinct with its CustomerID property. We needed to have versioning for the said entity and so we introduced an additional Version integer property. I've been seeing routines throwing CustomerID alongside Version to refer to a particular Customer object. Ideally (from what I know), the said routines should be just interacting with an instance of Customer object in the first place. The versioning should have been implemented internally through encapsulation and calling routines should be unaware about versioning which should've been handled by the Cutomer class himself.
I hate to see codes throwing and consuming PK's of business entities as parameters and not instances of business entities. Anyone who wants to shed a light on these? Am I on the right track?