diff --git a/doc/LearningOutcomes.md b/doc/LearningOutcomes.md index 62daa4c04..b0d5d1235 100644 --- a/doc/LearningOutcomes.md +++ b/doc/LearningOutcomes.md @@ -16,18 +16,18 @@ After studying this code and completing the corresponding exercises, you should ------------------------------------------------------------------------------------------------------ -### Apply Encapsulation `[LO-Encapsulation]` +## Apply Encapsulation `[LO-Encapsulation]` -##### Exercise: Encapsulate `CommandResult` class members +#### Exercise: Encapsulate `CommandResult` class members * A member of the `CommandResult` class is not encapsulated. i.e. it is visible outside the object. Hide it so that it can only be accessed using methods provided. ------------------------------------------------------------------------------------------------------ -### Implement a class `[LO-ImplementClass]` +## Implement a class `[LO-ImplementClass]` -##### Exercise: Split `Address` into more classes +#### Exercise: Split `Address` into more classes * Assume the address is entered in the following format `a/BLOCK, STREET, UNIT, POSTAL_CODE`
e.g. `a/123, Clementi Ave 3, #12-34, 231534` * Split the `Address` class as follows.
@@ -36,12 +36,12 @@ After studying this code and completing the corresponding exercises, you should ------------------------------------------------------------------------------------------------------ -### Follow the Single Responsibility Principle `[LO-SRP]` +## Follow the Single Responsibility Principle `[LO-SRP]` The *Single Responsibility Principle (SRP)* states that a class should have only one reason to change. The code given follows SRP to a reasonable extent, but there are places where it can be applied further. -##### Exercise: Split `TextUi` class +#### Exercise: Split `TextUi` class The exercise in the `LO-ImplementClass` section is somewhat related to SRP as well. Here's a slightly more difficult exercise. @@ -50,7 +50,7 @@ Here's a slightly more difficult exercise. Try to extract out the responsibility of Formatting text for display (e.g. adding decorations) in to a separate class named `Formatter`. -##### Resources +#### Resources * [An explanation of the SRP](http://www.oodesign.com/single-responsibility-principle.html) from www.oodesign.com * [Another explanation (more detailed)](http://code.tutsplus.com/tutorials/solid-part-1-the-single-responsibility-principle--net-36074) by Patkos Csaba @@ -58,33 +58,33 @@ Here's a slightly more difficult exercise. ------------------------------------------------------------------------------------------------------ -### Handle Exceptions `[LO-Exceptions]` +## Handle Exceptions `[LO-Exceptions]` **Resources**: * [Best Practices for Exception Handling](http://www.onjava.com/pub/a/onjava/2003/11/19/exceptions.html) by Gunjan Doshi -##### Exercise: Handle 'file deleted' situation +#### Exercise: Handle 'file deleted' situation * The current code does not handle the situation where the user deletes the storage file while the AddressBook program is running. Use exceptions to handle that situation. ------------------------------------------------------------------------------------------------------ -### Use Inheritance to achieve code reuse `[LO-Inheritance]` +## Use Inheritance to achieve code reuse `[LO-Inheritance]` Note how the `Command` class contains some code that is reused by some of its child classes. By defining `*Command` classes as child classes of `Command`, we have avoided having to duplicate those methods in multiple `*Command` classes. -##### Exercise: Extract a `Contact` class +#### Exercise: Extract a `Contact` class * Extract commonalities from `Phone`, `Email` and `Address` classes into a parent class called `Contact`.
------------------------------------------------------------------------------------------------------ -### Follow Interface Segregation Principle `[LO-ISP]` +## Follow Interface Segregation Principle `[LO-ISP]` The *Interface-Segregation Principle (ISP)* states that no client should be forced to depend on methods it does not use. @@ -92,7 +92,7 @@ Note how the `Person` class implements the `ReadOnlyPerson` interface so that cl `Person` objects can access `Person` objects through the `ReadOnlyPerson` interface instead. -##### Exercise: Add a `Printable` interface +#### Exercise: Add a `Printable` interface * Add a `Printable` interface as follows.
@@ -119,13 +119,13 @@ Note how the `Person` class implements the `ReadOnlyPerson` interface so that cl ------------------------------------------------------------------------------------------------------ -### Use class-level members `[LO-ClassLevel]` +## Use class-level members `[LO-ClassLevel]` Note how some of the variables and methods are declared `static`. That means they are *class-level* members rather than *instance-level* members.
e.g.
`Main.VERSION`, `Name.EXAMPLE`, `Utils.isAnyNull(...)` -##### Exercise: Add class-level members +#### Exercise: Add class-level members * Convert the `parse(...)` method of the `Parser` class to a class-level method. Note how this method can be either class-level or instance-level. @@ -140,7 +140,7 @@ e.g.
`Main.VERSION`, `Name.EXAMPLE`, `Utils.isAnyNull(...)` ------------------------------------------------------------------------------------------------------ -### Use Composition `[LO-Composition]` +## Use Composition `[LO-Composition]` Note the following examples of *composition* (filled diamond): @@ -158,11 +158,11 @@ Container | Contained ------------------------------------------------------------------------------------------------------ -### Use Association Classes `[LO-AssociationClass]` +## Use Association Classes `[LO-AssociationClass]` The current design does not have any association classes. -##### Exercise: Add an Association Class `Tagging` +#### Exercise: Add an Association Class `Tagging` * Assume the following: 1. There are commands to add and remove tags to a person in the address book. @@ -181,7 +181,7 @@ The current design does not have any association classes. ------------------------------------------------------------------------------------------------------ -### Use JUnit to implement unit tests `[LO-JUnit]` +## Use JUnit to implement unit tests `[LO-JUnit]` Note the `test/seedu/addressbook/parser/ParserTest.java` class that users Junit to implement automated unit tests. @@ -203,7 +203,7 @@ Note the `test/seedu/addressbook/parser/ParserTest.java` class that users Junit * [Learning from Appleā€™s #gotofail Security Bug](http://avandeursen.com/2014/02/22/gotofail-security/) - How unit testing (and other good coding practices) could have prevented a major security bug. -##### Exercise: Write unit tests for the `Utils` class +#### Exercise: Write unit tests for the `Utils` class * First, make sure you know how to run JUnit tests by running the `ParserTest.java`. Instructions are in the [Developer Guide](DeveloperGuide.md#junit-tests). @@ -211,7 +211,7 @@ Note the `test/seedu/addressbook/parser/ParserTest.java` class that users Junit ------------------------------------------------------------------------------------------------------ -### Use TDD `[LO-TDD]` +## Use TDD `[LO-TDD]` It's recommended you do `[LO-JUnit]` before attempting TDD. @@ -230,7 +230,7 @@ It's recommended you do `[LO-JUnit]` before attempting TDD. * [Dev opinion][Programmers Without TDD Will be Unemployable by 2022](http://css.dzone.com/articles/programmers-without-tdd-will) -##### Exercise: Add a method in TDD fashion +#### Exercise: Add a method in TDD fashion * Add the following method to the `Name` class. Use the TDD technique to add the method. Commit after each step. @@ -249,9 +249,9 @@ It's recommended you do `[LO-JUnit]` before attempting TDD. ------------------------------------------------------------------------------------------------------ -### Work in a 2KLoC code base `[LO-2KLoC]` +## Work in a 2KLoC code base `[LO-2KLoC]` -##### Exercise: Enhance AddressBook +#### Exercise: Enhance AddressBook Add a feature to AddressBook. Here are some suggestions. * An Edit command diff --git a/doc/UserGuide.md b/doc/UserGuide.md index 330592c5d..3e4baae95 100644 --- a/doc/UserGuide.md +++ b/doc/UserGuide.md @@ -3,7 +3,7 @@ This product is not meant for end-users and therefore there is no user-friendly installer. Please refer to the [Setting up](DeveloperGuide.md#setting-up) section to learn how to set up the project. -### Starting the program +## Starting the program 1. Find the project in the `Project Explorer` or `Package Explorer` (usually located at the left side) 2. Right click on the project @@ -12,12 +12,12 @@ Please refer to the [Setting up](DeveloperGuide.md#setting-up) section to learn -### Viewing help : `help` +## Viewing help : `help` Format: `help` > Help is also shown if you enter an incorrect command e.g. `abcd` -### Adding a person: `add` +## Adding a person: `add` Adds a person to the address book
Format: `add NAME [p]p/PHONE_NUMBER [p]e/EMAIL [p]a/ADDRESS [t/TAG]...` @@ -33,11 +33,11 @@ Examples: * `add John Doe p/98765432 e/johnd@gmail.com a/John street, block 123, #01-01` * `add Betsy Crowe pp/1234567 e/betsycrowe@gmail.com pa/Newgate Prison t/criminal t/friend` -### Listing all persons : `list` +## Listing all persons : `list` Shows a list of all persons in the address book.
Format: `list` -### Finding all persons containing any keyword in their name: `find` +## Finding all persons containing any keyword in their name: `find` Finds persons whose names contain any of the given keywords.
Format: `find KEYWORD [MORE_KEYWORDS]` @@ -50,7 +50,7 @@ Examples: * `find Betsy Tim John`
Returns Any person having names `Betsy`, `Tim`, or `John` -### Deleting a person : `delete` +## Deleting a person : `delete` Deletes the specified person from the address book. Irreversible.
Format: `delete INDEX` @@ -65,7 +65,7 @@ Examples: `delete 1`
Deletes the 1st person in the results of the `find` command. -### View non-private details of a person : `view` +## View non-private details of a person : `view` Displays the non-private details of the specified person.
Format: `view INDEX` @@ -80,7 +80,7 @@ Examples: `view 1`
Views the 1st person in the results of the `find` command. -### View all details of a person : `viewall` +## View all details of a person : `viewall` Displays all details (including private details) of the specified person.
Format: `viewall INDEX` @@ -95,19 +95,19 @@ Examples: `viewall 1`
Views all details of the 1st person in the results of the `find` command. -### Clearing all entries : `clear` +## Clearing all entries : `clear` Clears all entries from the address book.
Format: `clear` -### Exiting the program : `exit` +## Exiting the program : `exit` Exits the program.
Format: `exit` -### Saving the data +## Saving the data Address book data are saved in the hard disk automatically after any command that changes the data.
There is no need to save manually. -### Changing the save location +## Changing the save location Address book data are saved in a file called `addressbook.txt` in the project root folder. You can change the location by specifying the file path as a program argument.