OOP getter/setter methods

Hi all, I have a question about getter/setter methods. Basically I’m trying to start write more OOP compliant code, and getter/setter methods seem to be counter intuitive.

So from what I understand, when I have an object, and it has say 5 properties that I want to read and/or modify, I’ll have to make 5 getter methods, and 5 setter methods, one for each property.

It seems to me like it would be a lot easier just to make each one of those properties public, or just pass the constructor a data object that had all of the information for that instance of the class then to be writing dozens of methods just to get and set properties.

Basically, I’m wondering, do people always do this? When is it ok to break the rules… or is it never ok (from a good coding perspective)?

Thanks!