How To Encapsulate The Data?

Member

mitchell

by mitchell , in category: Technology , 15 days ago

How To Encapsulate The Data?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by ashtyn , 15 days ago

To encapsulate the data, you need to define a public interface for it. The public interface is used in your codebase so all of your other components can access and use this information or save changes back to this object. Then have private methods that are only accessible by using getters and setters. These provide some security by not allowing anyone to access the data outside of what's defined in our public interface.