Skip to content

Commit

Permalink
Tweak heading levels in LO and UG docs
Browse files Browse the repository at this point in the history
  • Loading branch information
damithc committed Sep 7, 2016
1 parent 2ea1ec8 commit 54c89d2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
48 changes: 24 additions & 24 deletions doc/LearningOutcomes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` <br>
e.g. `a/123, Clementi Ave 3, #12-34, 231534`
* Split the `Address` class as follows.<br>
Expand All @@ -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.
Expand All @@ -50,49 +50,49 @@ 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
* [A book chapter on SRP](https://drive.google.com/file/d/0ByOwmqah_nuGNHEtcU5OekdDMkk/view) by Robert C. Martin

------------------------------------------------------------------------------------------------------

### 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`.<br>
<img src="images/ContactClassHierarchy.png" width='250' />

------------------------------------------------------------------------------------------------------

### 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.

Note how the `Person` class implements the `ReadOnlyPerson` interface so that clients who don't need write access to
`Person` objects can access `Person` objects through the `ReadOnlyPerson` interface instead.
<img src="images/ReadOnlyPersonUsage.png" width='600' />

##### Exercise: Add a `Printable` interface
#### Exercise: Add a `Printable` interface

* Add a `Printable` interface as follows.<br>
<img src="images/PrintableInterface.png" width='400' />
Expand All @@ -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.<br>
e.g.<br> `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.
Expand All @@ -140,7 +140,7 @@ e.g.<br> `Main.VERSION`, `Name.EXAMPLE`, `Utils.isAnyNull(...)`

------------------------------------------------------------------------------------------------------

### Use Composition `[LO-Composition]`
## Use Composition `[LO-Composition]`

Note the following examples of *composition* (filled diamond):

Expand All @@ -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.
Expand All @@ -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.

Expand All @@ -203,15 +203,15 @@ 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).
* Add a `test/seedu/addressbook/common/UtilsTest.java` containing JUnit tests for the `Utils` class.

------------------------------------------------------------------------------------------------------

### Use TDD `[LO-TDD]`
## Use TDD `[LO-TDD]`

It's recommended you do `[LO-JUnit]` before attempting TDD.

Expand All @@ -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.

Expand All @@ -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
Expand Down
24 changes: 12 additions & 12 deletions doc/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -12,12 +12,12 @@ Please refer to the [Setting up](DeveloperGuide.md#setting-up) section to learn

<img src="images/Ui.png">

### 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<br>
Format: `add NAME [p]p/PHONE_NUMBER [p]e/EMAIL [p]a/ADDRESS [t/TAG]...`

Expand All @@ -33,11 +33,11 @@ Examples:
* `add John Doe p/98765432 e/[email protected] a/John street, block 123, #01-01`
* `add Betsy Crowe pp/1234567 e/[email protected] 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.<br>
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.<br>
Format: `find KEYWORD [MORE_KEYWORDS]`

Expand All @@ -50,7 +50,7 @@ Examples:
* `find Betsy Tim John`<br>
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.<br>
Format: `delete INDEX`

Expand All @@ -65,7 +65,7 @@ Examples:
`delete 1`<br>
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.<br>
Format: `view INDEX`

Expand All @@ -80,7 +80,7 @@ Examples:
`view 1`<br>
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.<br>
Format: `viewall INDEX`

Expand All @@ -95,19 +95,19 @@ Examples:
`viewall 1`<br>
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.<br>
Format: `clear`

### Exiting the program : `exit`
## Exiting the program : `exit`
Exits the program.<br>
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.<br>
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.<br>

Expand Down

0 comments on commit 54c89d2

Please sign in to comment.