d1chiqua / expertiza

Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation.
http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation
MIT License
1 stars 0 forks source link

Refactor and Optimize match_new_teams_to_topics method in BiddingTeamsAssignmentService #50

Open d1chiqua opened 1 month ago

d1chiqua commented 1 month ago

Right now, the match_new_teams_to_topics is breaking Single Responsibility Principle - we can test each method this way.

Break into the following methods: (1) Verify Intelligent Assignment (2) Get the SignUpTopics (3) Retrieve the unassigned teams (optimize queries) (4) Sort unassigned teams (optimize sort process)

d1chiqua commented 1 month ago

Common Mistakes Long methods are also a big issue. Most of the time, long methods contain nested loops or nested if statements, and handle multiple tasks instead of one. One big reason that students wrote long methods is that they tended to

place a new feature in an existing method rather than to cre- ate a new one. Likewise, students prefer to modify existing

switch or if blocks rather than to implement polymor- phism, since it is easier for students simply to add another

condition to the existing code than to understand an inheri- tance hierarchy structure across files. This violates a rule of

object-oriented design—when you see a switch statement, you should think of polymorphism [15].