vlingo / xoom-http

The VLINGO XOOM platform SDK for Reactive, scalable, high-throughput, and resilient HTTP server supporting RESTful services running on XOOM LATTICE and XOOM ACTORS.
https://vlingo.io
Mozilla Public License 2.0
52 stars 16 forks source link

Feature/refactoring #96

Open dhairya051 opened 2 years ago

dhairya051 commented 2 years ago

I have reviewed this project as a University assignment and have gone through a few possibilities of refactoring, mentioning below all of them:

  1. Renaming: In header.java, in header constructor, the spelling of initialCapacity was wrongly mentioned as initialCapactiy. In MediaTypeDescriptor.java, I gave a meaningful name to the variable Object o and gave it a name as Object object and replaced where it was used.
  2. Extract Method: In Action.java, from private method parse(), I extracted a method call getTheParameters() which will get the raw parameters as a parameter and process it and give the processes parameters to ease the complexity of parse method.
  3. Pull Up variable: As AbstractDispatcherPool was super class of 2 classes i.e. AgentDispatcherPool and ServerDispatcherPool and this both classes has AtomicLong dispatcherPoolIndex and long dispatcherPoolSize. So I performed Pull Up varaible refactoring and declared them in super class as protected and made them accessible in both sub classes.
  4. Extract Class: I observed "Insufficient Modularization" design smell in ResponseParser.java, So I separated VirtualStateParser from ResponseParser which resulted in eliminating the "Insufficient Modularization" design smell.
  5. Move Variable: In RequestHeader.java, the variable XForwardedFor was declared which was used in only ServerActor.java, so I moved the variable to ServerActor.java class.