0

I am working on a class project in java and have the following design specification.

I have a Scientist class and an ABCFundingApplication class (ABC being a body that grants scientists funding for their research). The scientist has certain attributes like his username,password,number of papers published, funding procured in the past etc etc..

The ABCFundingApplication class holds an array of type scientist which holds scientist objects. The ABCFundingApplication allows for the 'creation' of scientist objects and also to update profiles of existing scientist objects.

Now it says that the department ABC calculates whether a scientist receives funding or not by using some internal process in their firm, (insert funding algorithm here).

The spec sheet says for us to include this funding_decision algorithm in a method in the scientist class, my question is why can we not include it as part of the ABCFundingApplication class and just check whether for a particular scientist object in the scientist array, whether he/she will be granted funding? In my opinion this would be a cleaner implementation would it not?

3
  • 1
    Well your spec sheet seems to be missing an important part, which is the project or the research, a given scientist is to be granted funding for. And this is as important as the scientist's profile, if we would like to model the problem accurately. The decision algorithm would be fed the scientist's profile and the project. And you're right it doesn't make sense to implement it in the scientist profile class. Commented Aug 31, 2013 at 5:45
  • Passing a Scientist to a method in the ABCApplication would be much cleaner, but perhaps they are either planning for the use of this Scientist class in other applications that require the funding algorithm, or planning for future children of the Scientist class to override and have a custom algorithm. Remember, if this is a high school class, that some curriculum's use specific specs to reinforce certain objectives, even if they aren't logical, just because the curriculum requirements call for it. Commented Aug 31, 2013 at 5:49
  • ya I thought it might be to reinforce certain specific concepts that we had discussed in recent weeks in class. Thanks. Commented Aug 31, 2013 at 5:55

1 Answer 1

1

In a way I can understand why the spec sheet says to include the funding_decision in the scientist class. It's like putting the "Throw" method on the "Dice" object. Also because the ABCFundingApplication is more then just a body for granting fundings, it also creates and updates them. But I would prefer putting the method in the ABCFunding class, this class would represents the body, but would not do the creation or update of the scientists. It would extend the interface Funding so if there ever came a DEFFunding class, you could override the determineFunding method for each funding body.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.