Alonexc opened a new issue, #3827:
URL: https://github.com/apache/eventmesh/issues/3827

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Enhancement Request
   
   
![image](https://user-images.githubusercontent.com/91315508/234746690-ab2900e3-c79c-4d88-8ce8-00c05706decd.png)
   
![image](https://user-images.githubusercontent.com/91315508/234746695-0039207e-7c95-4fca-b101-2307c6d16506.png)
   
![image](https://user-images.githubusercontent.com/91315508/234746704-98e9c3fc-f5d7-4a85-9633-848ded7e2f2c.png)
   located at:
   
eventmesh-storage-plugin/eventmesh-storage-standalone/src/main/java/org/apache/eventmesh/storage/standalone/broker/MessageQueue.java
 line 32,68,87,105,129,152,178,
   
eventmesh-storage-plugin/eventmesh-storage-standalone/src/test/java/org/apache/eventmesh/storage/standalone/broker/MessageQueueTest.java
 line 46,53,60,67,74,81,94
   analysis and explanation:
   a. Public class variable fields do not respect the encapsulation principle 
and has three main disadvantages:
   Additional behavior such as validation cannot be added.
   The internal representation is exposed, and cannot be changed afterwards.
   Member values are subject to change from anywhere in the code and may not 
meet the programmer’s assumptions.
   By using private attributes and accessor methods (set and get), unauthorized 
modifications are prevented.
   b. Overriding or shadowing a variable declared in an outer scope can 
strongly impact the readability, and therefore the maintainability, of a piece 
of code. Further, it could lead maintainers to introduce bugs because they 
think they’re using one variable but are really using another.
   
   
   ### Describe the solution you'd like
   
   a. Change to use the private final modifier.
   
![image](https://user-images.githubusercontent.com/91315508/234746762-1f802337-f969-4b3a-86f6-a480bf92d44b.png)
   
![image](https://user-images.githubusercontent.com/91315508/234746776-d27a8482-5a79-4f1d-b5ef-538bf3c55c43.png)
   
![image](https://user-images.githubusercontent.com/91315508/234746789-9fde7c22-5933-44e1-9b06-fc8f7a1f82af.png)
   
   b. 'lock' rename.
   
![image](https://user-images.githubusercontent.com/91315508/234746822-a98f7a85-6a1e-40ed-97c8-60347b267a6d.png)
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to