Consider 3 classes:
Data class has some attributes: a,b,c
I’m looking for a design pattern so the Manipulator1 only has r/w access to a and b while Manipulator2 can change just b and c.
Any ideas?
I’m coding in Java BTW.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It could be seen as an application case of the Proxy pattern with the proxy regulating access to the Data object.
Personally, I consider it enough to program the manipulators to access the relevant fields only, but if access restriction on the data is a must for fear of malicious clients or similar, then proxy is the right thing to do.