milleruntime commented on pull request #2256:
URL: https://github.com/apache/accumulo/pull/2256#issuecomment-910521541


   > > Any ideas of how this could be more Object oriented?
   > 
   > OO can have many goals. One goal w/ interfaces and class impls is that 
many different impls can be added over time. In this case there is a fixed 
universe of impls that will not be expanding, so in my mind adding the 
indirection has little or no benefit in terms of making the code easier to 
maintain and understand.
   > 
   > Maybe making some of the changes like @DomGarguilo suggested to the 
current switch stmts will make them shorter and easier to follow. Seems like 
some comments about the importance of taking a snapshot may also be useful.
   
   It seems like there is a concrete state in this code (a User compaction with 
specific settings selected X files) that could be encapsulated in an object. 
Then that object could be passed around. There is a lot of checking the 
CompactionKind and different status objects, keeping some type of state. I 
think what you did with the FileManager is a step in the right direction but 
there could be more encapsulation that would make the code easier to understand 
and maintain.
   
   A large if or switch statement is almost always a clear indicator of code 
that needs an OO design. I just don't know the code like you do to know the 
specifics of that design.


-- 
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]


Reply via email to