Hi Yifan, it's great you're thinking about how to simplify the code!! I think there's value in making this ticket summary and description more clear. For example, assuming you're referring to the slave, and not the master:
Summary: Investigate simplifications to the slave message handlers validation logic. >From my experience, "reducing the size of the source" and "avoiding copy-pasting" should not be goals in and of themselves. As a contrived example, we should prefer a 1000 line clear and understandable program over a 100 line program that is very difficult to reason about but avoids copy-pasting. I've seen dogmatic adherence to code de-duplication lead to more confusing code and just want to make sure we're all on the same page there! All that to say, let's focus on how to make the code clear to understand; reducing code de-duplication and smaller source size will follow naturally! :) ---------- Forwarded message ---------- From: Yifan Gu (JIRA) <[email protected]> Date: Thu, Jun 12, 2014 at 10:25 PM Subject: [jira] [Created] (MESOS-1484) Make the checker code into modules To: [email protected] Yifan Gu created MESOS-1484: ------------------------------- Summary: Make the checker code into modules Key: MESOS-1484 URL: https://issues.apache.org/jira/browse/MESOS-1484 Project: Mesos Issue Type: Improvement Reporter: Yifan Gu Priority: Minor Currently, we can see a lot of similar codes checking the validation of frameworkId, slaveId, executorId and so on, in the beginning of the message handlers (say launchTasks, killTask). I think maybe we could put those codes into separate modules with well defined interfaces. I think this can help us to improve the readability of the code, reduce the size of the source, and more importantly, make it easier for folks to add new features (avoiding copy-pasting, which is error prone). Any ideas or discussion on this is highly welcome! Thank you! -- This message was sent by Atlassian JIRA (v6.2#6252)
