Skip to content

Commit

Permalink
Minor fixes on DeveloperGuide and comments (#240)
Browse files Browse the repository at this point in the history
Changes made:

1. Delete a few obsolete lines.
2. Changed Address Book to HealthBase in the text and some diagrams.
3. Reordered manual testing sections.
yuntongzhang authored Nov 13, 2018
1 parent 14e52a2 commit 86a177c
Showing 52 changed files with 147 additions and 155 deletions.
138 changes: 65 additions & 73 deletions docs/DeveloperGuide.adoc

Large diffs are not rendered by default.

Binary file modified docs/diagrams/HighLevelSequenceDiagrams.pptx
Binary file not shown.
Binary file modified docs/diagrams/LogicComponentClassDiagram.pptx
Binary file not shown.
Binary file modified docs/diagrams/LogicComponentSequenceDiagram.pptx
Binary file not shown.
Binary file modified docs/diagrams/ModelComponentClassBetterOopDiagram.pptx
Binary file not shown.
Binary file modified docs/diagrams/ModelComponentClassDiagram.pptx
Binary file not shown.
Binary file modified docs/diagrams/StorageComponentClassDiagram.pptx
Binary file not shown.
Binary file modified docs/images/DeletePersonSdForLogic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/LogicClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/ModelClassBetterOopDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/ModelClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/SDforDeletePerson.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/SDforDeletePersonEventHandling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/StorageClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/team/johndoe.adoc
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@

== Overview

HealthBase - Level 4 is a desktop address book application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.
HealthBase - Level 4 is a desktop HealthBase application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

== Summary of contributions

8 changes: 4 additions & 4 deletions src/main/java/seedu/address/MainApp.java
Original file line number Diff line number Diff line change
@@ -77,9 +77,9 @@ public void init() throws Exception {
}

/**
* Returns a {@code ModelManager} with the data from {@code storage}'s address book and {@code userPrefs}. <br>
* The data from the sample address book will be used instead if {@code storage}'s address book is not found,
* or an empty address book will be used instead if errors occur when reading {@code storage}'s address book.
* Returns a {@code ModelManager} with the data from {@code storage}'s HealthBase and {@code userPrefs}. <br>
* The data from the sample HealthBase will be used instead if {@code storage}'s HealthBase is not found,
* or an empty HealthBase will be used instead if errors occur when reading {@code storage}'s HealthBase.
*/
private Model initModelManager(Storage storage, UserPrefs userPrefs) {
Optional<ReadOnlyHealthBase> healthBaseOptional;
@@ -185,7 +185,7 @@ public void start(Stage primaryStage) {

@Override
public void stop() {
logger.info("============================ [ Stopping Address Book ] =============================");
logger.info("============================ [ Stopping HealthBase ] =============================");
ui.stop();
try {
storage.saveUserPrefs(userPrefs);
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@

//@@author snajef
/**
* Adds a person to the address book.
* Adds a person to HealthBase.
*/
public class AddmedsCommand extends Command {
public static final String COMMAND_WORD = "addmeds";
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/commands/ClearCommand.java
Original file line number Diff line number Diff line change
@@ -7,12 +7,12 @@
import seedu.address.model.Model;

/**
* Clears the address book.
* Clears HealthBase.
*/
public class ClearCommand extends Command {

public static final String COMMAND_WORD = "clear";
public static final String MESSAGE_SUCCESS = "Address book has been cleared!";
public static final String MESSAGE_SUCCESS = "HealthBase has been cleared!";


@Override
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
import seedu.address.model.person.Person;

/**
* Deletes a person identified using it's displayed index from the address book.
* Deletes a person identified using it's displayed index from HealthBase.
*/
public class DeleteCommand extends Command {

4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
import seedu.address.model.tag.Tag;

/**
* Edits the details of an existing person in the address book.
* Edits the details of an existing person in HealthBase.
*/
public class EditCommand extends Command {

@@ -52,7 +52,7 @@ public class EditCommand extends Command {

public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Person: %1$s";
public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided.";
public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book.";
public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in HealthBase.";

private final Index index;
private final EditPersonDescriptor editPersonDescriptor;
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ public class ExitCommand extends Command {

public static final String COMMAND_WORD = "exit";

public static final String MESSAGE_EXIT_ACKNOWLEDGEMENT = "Exiting Address Book as requested ...";
public static final String MESSAGE_EXIT_ACKNOWLEDGEMENT = "Exiting HealthBase as requested ...";

@Override
public CommandResult execute(Model model, CommandHistory history) {
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
import seedu.address.model.person.NameContainsKeywordsPredicate;

/**
* Finds and lists all persons in address book whose name contains any of the argument keywords.
* Finds and lists all persons in HealthBase whose name contains any of the argument keywords.
* Keyword matching is case insensitive.
*/
public class FindCommand extends Command {
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
import seedu.address.model.person.Person;

/**
* Resets the address book and adds new people based on a set of templates.
* Resets HealthBase and adds new people based on a set of templates.
* Developer-mode only command.
*/
public class GendataCommand extends Command {
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
import seedu.address.model.Model;

/**
* Lists all persons in the address book to the user.
* Lists all persons in HealthBase to the user.
*/
public class ListCommand extends Command {

Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
import seedu.address.model.person.Person;

/**
* Selects a person identified using it's displayed index from the address book.
* Selects a person identified using it's displayed index from HealthBase.
*/
public class SelectCommand extends Command {

16 changes: 8 additions & 8 deletions src/main/java/seedu/address/model/HealthBase.java
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ public void resetData(ReadOnlyHealthBase newData) {
//// person-level operations

/**
* Returns true if a person with the same identity as {@code person} exists in the address book.
* Returns true if a person with the same identity as {@code person} exists in HealthBase.
*/
public boolean hasPerson(Person person) {
requireNonNull(person);
@@ -108,25 +108,25 @@ public void reCheckInPerson(Person toReturn) {
}

/**
* Adds a person to the checkedOutPerson list of the address book.
* The person must not already exist in the checkedOutPerson list of the address book.
* Adds a person to the checkedOutPerson list of HealthBase.
* The person must not already exist in the checkedOutPerson list of HealthBase.
*/
public void addCheckedOutPerson(Person p) {
checkedOutPersons.add(p);
}

/**
* Adds a person to the person list of address book.
* The person must not already exist in person list of the address book.
* Adds a person to the person list of HealthBase.
* The person must not already exist in person list of HealthBase.
*/
public void addPerson(Person p) {
persons.add(p);
}

/**
* Replaces the given person {@code target} in the list with {@code editedPerson}.
* {@code target} must exist in the address book.
* The person identity of {@code editedPerson} must not be the same as another existing person in the address book.
* {@code target} must exist in HealthBase.
* The person identity of {@code editedPerson} must not be the same as another existing person in HealthBase.
*/
public void updatePerson(Person target, Person editedPerson) {
requireNonNull(editedPerson);
@@ -136,7 +136,7 @@ public void updatePerson(Person target, Person editedPerson) {

/**
* Removes {@code key} from this {@code HealthBase}.
* {@code key} must exist in the address book.
* {@code key} must exist in HealthBase.
*/
public void removePerson(Person key) {
persons.remove(key);
14 changes: 7 additions & 7 deletions src/main/java/seedu/address/model/Model.java
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ public interface Model {
ReadOnlyHealthBase getHealthBase();

/**
* Returns true if a person with the same identity as {@code person} exists in the address book.
* Returns true if a person with the same identity as {@code person} exists in HealthBase.
*/
boolean hasPerson(Person person);

@@ -30,32 +30,32 @@ public interface Model {

/**
* Checkout the given person.
* The person must exist in person list of the address book.
* The person must exist in person list of HealthBase.
*/
void checkOutPerson(Person person);

/**
* Re-checkin the given person.
* The person must exist in the checkedOutPerson list of the address book.
* The person must exist in the checkedOutPerson list of HealthBase.
*/
void reCheckInPerson(Person person);

/**
* Deletes the given person.
* The person must exist in the address book.
* The person must exist in HealthBase.
*/
void deletePerson(Person target);

/**
* Adds the given person.
* {@code person} must not already exist in the address book.
* {@code person} must not already exist in HealthBase.
*/
void addPerson(Person person);

/**
* Replaces the given person {@code target} with {@code editedPerson}.
* {@code target} must exist in the address book.
* The person identity of {@code editedPerson} must not be the same as another existing person in the address book.
* {@code target} must exist in HealthBase.
* The person identity of {@code editedPerson} must not be the same as another existing person in HealthBase.
*/
void updatePerson(Person target, Person editedPerson);

4 changes: 2 additions & 2 deletions src/main/java/seedu/address/model/ModelManager.java
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
import seedu.address.model.person.Person;

/**
* Represents the in-memory model of the address book data.
* Represents the in-memory model of HealthBase data.
*/
public class ModelManager extends ComponentManager implements Model {
private static final Logger logger = LogsCenter.getLogger(ModelManager.class);
@@ -31,7 +31,7 @@ public ModelManager(ReadOnlyHealthBase healthBase, UserPrefs userPrefs) {
super();
requireAllNonNull(healthBase, userPrefs);

logger.fine("Initializing with address book: " + healthBase + " and user prefs " + userPrefs);
logger.fine("Initializing with HealthBase: " + healthBase + " and user prefs " + userPrefs);

internalHealthBase = new HealthBase(healthBase);
filteredPersons = new FilteredList<>(internalHealthBase.getPersonList());
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/ReadOnlyHealthBase.java
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import seedu.address.model.person.Person;

/**
* Unmodifiable view of an address book
* Unmodifiable view of an HealthBase
*/
public interface ReadOnlyHealthBase {

2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Address.java
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents a Person's address in the address book.
* Represents a Person's address in HealthBase.
* Guarantees: immutable; is valid as declared in {@link #isValidAddress(String)}
*/
public class Address {
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Email.java
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents a Person's email in the address book.
* Represents a Person's email in HealthBase.
* Guarantees: immutable; is valid as declared in {@link #isValidEmail(String)}
*/
public class Email {
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Name.java
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents a Person's name in the address book.
* Represents a Person's name in HealthBase.
* Guarantees: immutable; is valid as declared in {@link #isValidName(String)}
*/
public class Name {
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Nric.java
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

//@@author snajef
/**
* Represents a Person's NRIC in the address book. Guarantees: immutable; is
* Represents a Person's NRIC in HealthBase. Guarantees: immutable; is
* valid as declared in {@link #isValidNric(String)}
*/
public class Nric {
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Person.java
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
import seedu.address.model.visitor.VisitorList;

/**
* Represents a Person in the address book. Guarantees: details are present and
* Represents a Person in HealthBase. Guarantees: details are present and
* not null, field values are validated, immutable.
*/
public class Person {
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Phone.java
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents a Person's phone number in the address book.
* Represents a Person's phone number in HealthBase.
* Guarantees: immutable; is valid as declared in {@link #isValidPhone(String)}
*/
public class Phone {
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/tag/Tag.java
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import static seedu.address.commons.util.AppUtil.checkArgument;

/**
* Represents a Tag in the address book.
* Represents a Tag in HealthBase.
* Guarantees: immutable; name is valid as declared in {@link #isValidTagName(String)}
*/
public class Tag {
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/storage/Storage.java
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ public interface Storage extends HealthBaseStorage, UserPrefsStorage {
void saveHealthBase(ReadOnlyHealthBase healthBase) throws IOException;

/**
* Saves the current version of the Address Book to the hard disk.
* Saves the current version of HealthBase to the hard disk.
* Creates the data file if it is missing.
* Raises {@link DataSavingExceptionEvent} if there was an error during saving.
*/
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/storage/XmlFileStorage.java
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public static void saveDataToFile(Path file, XmlSerializableHealthBase healthBas
}

/**
* Returns address book in the file or an empty address book
* Returns HealthBase in the file or an empty HealthBase
*/
public static XmlSerializableHealthBase loadDataFromSaveFile(Path file) throws DataConversionException,
FileNotFoundException {
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ public XmlSerializableHealthBase(ReadOnlyHealthBase src) {
}

/**
* Converts this address book into the model's {@code HealthBase} object.
* Converts this HealthBase into the model's {@code HealthBase} object.
*
* @throws IllegalValueException if there were any data constraints violated or duplicates in the
* {@code XmlAdaptedPerson}.
2 changes: 1 addition & 1 deletion src/test/java/seedu/address/TestApp.java
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) {
}

/**
* Returns a defensive copy of the address book data stored inside the storage file.
* Returns a defensive copy of HealthBase data stored inside the storage file.
*/
public HealthBase readStorageHealthBase() {
try {
2 changes: 1 addition & 1 deletion src/test/java/seedu/address/logic/LogicManagerTest.java
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ private void assertCommandFailure(String inputCommand, Class<?> expectedExceptio
* Executes the command, confirms that the result message is correct and that the expected exception is thrown,
* and also confirms that the following two parts of the LogicManager object's state are as expected:<br>
* - the internal model manager data are same as those in the {@code expectedModel} <br>
* - {@code expectedModel}'s address book was saved to the storage file.
* - {@code expectedModel}'s HealthBase was saved to the storage file.
*/
private void assertCommandBehavior(Class<?> expectedException, String inputCommand,
String expectedMessage, Model expectedModel) {
Original file line number Diff line number Diff line change
@@ -231,7 +231,7 @@ public static void assertCommandSuccess(Command command, Model actualModel, Comm
* Executes the given {@code command}, confirms that <br>
* - a {@code CommandException} is thrown <br>
* - the CommandException message matches {@code expectedMessage} <br>
* - the address book and the filtered person list in the {@code actualModel}
* - HealthBase and the filtered person list in the {@code actualModel}
* remain unchanged <br>
* - {@code actualCommandHistory} remains unchanged.
*/
@@ -257,7 +257,7 @@ public static void assertCommandFailure(Command command, Model actualModel, Comm

/**
* Updates {@code model}'s filtered list to show only the person at the given
* {@code targetIndex} in the {@code model}'s address book.
* {@code targetIndex} in the {@code model}'s HealthBase.
*/
public static void showPersonAtIndex(Model model, Index targetIndex) {
assertTrue(targetIndex.getZeroBased() < model.getFilteredPersonList().size());
@@ -271,7 +271,7 @@ public static void showPersonAtIndex(Model model, Index targetIndex) {

/**
* Deletes the first person in {@code model}'s filtered list from
* {@code model}'s address book.
* {@code model}'s HealthBase.
*/
public static void deleteFirstPerson(Model model) {
Person firstPerson = model.getFilteredPersonList().get(0);
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ public void execute_invalidIndexFilteredList_throwsCommandException() {
showPersonAtIndex(model, INDEX_FIRST_PERSON);

Index outOfBoundIndex = INDEX_SECOND_PERSON;
// ensures that outOfBoundIndex is still in bounds of address book list
// ensures that outOfBoundIndex is still in bounds of HealthBase list
assertTrue(outOfBoundIndex.getZeroBased() < model.getHealthBase().getPersonList().size());

DeleteCommand deleteCommand = new DeleteCommand(outOfBoundIndex);
Loading

0 comments on commit 86a177c

Please sign in to comment.