Skip to content

Commit

Permalink
docs: copy-edit
Browse files Browse the repository at this point in the history
The adoc files were translated from their corresponding markdown files
using pandoc.

However, pandoc did not get the translation completely correct, and so
there are some mistakes here and there.

Copy-edit the adoc files by reading through them, comparing them with
their corresponding markdown files, and correcting the errors.
  • Loading branch information
pyokagan committed Jul 4, 2018
1 parent da519a9 commit 28ef63c
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 77 deletions.
2 changes: 1 addition & 1 deletion docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ image::mainClassDiagram.png[]
[appendix]
== User Stories

Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*`
Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (unlikely to have) - `*`

[width="100%",cols="22%,<23%,<25%,<30%",options="header",]
|===========================================================================================================================================
Expand Down
61 changes: 21 additions & 40 deletions docs/LearningOutcomes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
:toclevels: 1
:imagesDir: images
:stylesDir: stylesheets
ifdef::env-github[]
:note-caption: :information_source:
endif::[]

After studying this code and completing the corresponding exercises, you should be able to,

toc::[]

'''

== Utilize User Stories `[LO-UserStories]`

=== References
Expand All @@ -20,9 +21,7 @@ toc::[]
=== Exercise: Add more user stories

* Assume you are planing to expand the functionality of the AddressBook (but keep it as a CLI application).
What other user stories do you think AddressBook should support? Add those user stories to the `DeveloperGuide.md`.

'''''
What other user stories do you think AddressBook should support? Add those user stories to the `DeveloperGuide.adoc`.

== Utilize use cases `[LO-UseCases]`

Expand All @@ -32,13 +31,11 @@ What other user stories do you think AddressBook should support? Add those user

=== Exercise: Add a 'Rename tag' use case

* Add a use case to the `DeveloperGuide.md` to cover the case of _renaming of an existing tag_.
* Add a use case to the `DeveloperGuide.adoc` to cover the case of _renaming of an existing tag_.
e.g. rename the tag `friends` to `buddies` (i.e. all persons who had the `friends` tag will now have
a `buddies` tag instead)
Assume that AddressBook confirms the change with the user before carrying out the operation.

'''''

== Use Non Functional Requirements `[LO-NFR]`

=== References
Expand All @@ -47,9 +44,7 @@ Assume that AddressBook confirms the change with the user before carrying out th

=== Exercise: Add more NFRs

* Add some more NFRs to the `DeveloperGuide.md`

'''''
* Add some more NFRs to the `DeveloperGuide.adoc`

== Use Polymorphism `[LO-Polymorphism]`

Expand All @@ -67,10 +62,11 @@ command types that mutate the data. e.g. `AddCommand`
Take advantage of the the new method you added to limit file saving to only for command types that mutate data.
i.e. `add` command should always save the data while `list` command should never save data to the file.

Note: There may be better ways to limit file saving to commands that mutate data. The above approach, while not
[NOTE]
====
There may be better ways to limit file saving to commands that mutate data. The above approach, while not
optimal, will give you chance to implement a polymorphic behavior.

'''''
====

== Use abstract classes/methods `[LO-Abstract]`

Expand All @@ -82,8 +78,6 @@ optimal, will give you chance to implement a polymorphic behavior.

* Make the `Command#execute()` method abstract (hint: refer to the comment given below the method)

'''''

== Use interfaces `[LO-Interfaces]`

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.
Expand All @@ -105,22 +99,20 @@ image::PrintableInterface.png[width=400]
[source,java]
----
/**
* Returns a concatenated version of the printable strings of each object.
*/
String getPrintableString(Printable... printables){
* Returns a concatenated version of the printable strings of each object.
*/
String getPrintableString(Printable... printables) {
----
+
The above method can be used to get a printable string representing a bunch of person details.
For example, you should be able to call that method like this:
+
[source,java]
----
//p is a Person object
return getPrintableString(p.getPhone(), p.getEmail(), p.getAddress());
// p is a Person object
return getPrintableString(p.getPhone(), p.getEmail(), p.getAddress());
----

'''''

== Follow Liskov Substitution Principle `[LO-LSP]`

=== References
Expand All @@ -137,8 +129,6 @@ the parent class.
the programmer to enforce it. For example, if the method in the parent class works for `null` input, the overridden
method in the child class should not reject `null` inputs. This will not be enforced by the compiler.

'''''

== Use Java-FX for GUI programming `[LO-JavaFx]`

=== References
Expand All @@ -149,8 +139,6 @@ method in the child class should not reject `null` inputs. This will not be enfo

* Do some enhancements to the AddressBook GUI. e.g. add an application icon, change font size/style

'''''

== Analyze Coupling and Cohesion of designs `[LO-CouplingCohesion]`

* Notice how having a separate `Formattter` class (an application of the Single Responsibility Principle) improves the _cohesion_ of the `MainWindow` class as well as the `Formatter` class.
Expand All @@ -164,8 +152,6 @@ method in the child class should not reject `null` inputs. This will not be enfo

* Where else in the design coupling can be reduced further, or cohesion can be increased further?

'''''

[[apply-dependency-inversion-principle-lo-dip]]
== Apply Dependency Inversion Principle `[LO-DIP]`

Expand All @@ -182,8 +168,6 @@ method in the child class should not reject `null` inputs. This will not be enfo
image::LogicStroageFileDIP.png[width=300]
* Where else in the code do you notice the application of DIP?

'''''

== Use Dependency Injection `[LO-DI]`

Note how `Logic` class depends on the `StorageFile` class. This means when testing the `Logic` class,
Expand All @@ -201,13 +185,16 @@ class.
+
image::DependencyInjection.png[width=600]
+
_________________________________________________________________________________________________________
[NOTE]
====
If you did the exercise in <<apply-dependency-inversion-principle-lo-dip, `LO-DIP`>>
already but those changes are in a different branch, you may be able to reuse some of those commits
by cherry picking them from that branch to the branch you created for this exercise.
Note: _cherry picking_ is simply copy-pasting a commit from one branch to another. In SourceTree, you can
right-click on the commit your want to copy to the current branch, and choose 'Cherry pick'
_________________________________________________________________________________________________________
right-click on the commit your want to copy to the current branch, and choose 'Cherry pick'.
====

* Implement the `StorageStub` such that calls to the `save` method do nothing (i.e. empty method body). +
* Update the `LogicTest` to work with the `StorageStub` instead of the actual `StorageFile` object.
i.e. `Logic` injects a `StorageStub` object to replace the dependency of `Logic` on `StorageFile` before
Expand All @@ -218,8 +205,6 @@ In this case we do not apply the DIP but we still achieve DI.
+
image::DependencyInjectionWithoutDIP.png[width=250]

'''''

== Apply Open-Closed Principle `[LO-OCP]`

=== References
Expand All @@ -237,12 +222,8 @@ after applying DIP as given in <<apply-dependency-inversion-principle-lo-dip, `L
How can you improve `Logic`'s OCP-compliance further so that it can not only work with different types
of storages, but different number of storages (e.g. save to both a text file and a database).

'''''

== Work in a 3KLoC code base `[LO-3KLoC]`

=== Exercise: Enhance AddressBook

* Enhance AddressBook in some way. e.g. add a new command

'''''
83 changes: 47 additions & 36 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
= User Guide
:imagesDir: images
:stylesDir: stylesheets
ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
endif::[]

This product is not meant for end-users and therefore there is no user-friendly installer.
Please refer to the <<DeveloperGuide#setting-up, Setting up>> section to learn how to set up the project.
Expand All @@ -19,24 +23,25 @@ image::Ui.png[]

Format: `help`

________________________________________________________________
[TIP]
====
Help is also shown if you enter an incorrect command e.g. `abcd`
________________________________________________________________
====

== Adding a person: `add`

Adds a person to the address book
Adds a person to the address book. +
Format: `add NAME [p]p/PHONE_NUMBER [p]e/EMAIL [p]a/ADDRESS [t/TAG]...`

_________________________________________________________________________________________________________
****
Words in `UPPER_CASE` are the parameters, items in `SQUARE_BRACKETS` are optional,
items with `...` after them can have multiple instances. Order of parameters are fixed.
Put a `p` before the phone / email / address prefixes to mark it as `private`. `private` details can only
be seen using the `viewall` command.
Persons can have any number of tags (including 0)
_________________________________________________________________________________________________________
****

Examples:

Expand All @@ -45,94 +50,100 @@ Examples:

== Listing all persons : `list`

Shows a list of all persons in the address book.
Shows a list of all persons in the address book. +
Format: `list`

== Finding all persons containing any keyword in their name: `find`

Finds persons whose names contain any of the given keywords.
Finds persons whose names contain any of the given keywords. +
Format: `find KEYWORD [MORE_KEYWORDS]`

___________________________________________________________________________________________________
[NOTE]
====
The search is case sensitive, the order of the keywords does not matter, only the name is searched,
and persons matching at least one keyword will be returned (i.e. `OR` search).
___________________________________________________________________________________________________
====

Examples:

* `find John`
Returns `John Doe` but not `john`
* `find Betsy Tim John`
Returns Any person having names `Betsy`, `Tim`, or `John`
* `find John` +
Returns `John Doe` but not `john`.

* `find Betsy Tim John` +
Returns Any person having names `Betsy`, `Tim`, or `John`.

== Deleting a person : `delete`

Deletes the specified person from the address book. Irreversible.
Deletes the specified person from the address book. Irreversible. +
Format: `delete INDEX`

______________________________________________________________________
****
Deletes the person at the specified `INDEX`.
The index refers to the index number shown in the most recent listing.
______________________________________________________________________
****

Examples:

* `list`
`delete 2`
* `list` +
`delete 2` +
Deletes the 2nd person in the address book.
* `find Betsy`
`delete 1`

* `find Betsy` +
`delete 1` +
Deletes the 1st person in the results of the `find` command.

== View non-private details of a person : `view`

Displays the non-private details of the specified person.
Displays the non-private details of the specified person. +
Format: `view INDEX`

______________________________________________________________________
****
Views the person at the specified `INDEX`.
The index refers to the index number shown in the most recent listing.
______________________________________________________________________
****

Examples:

* `list`
`view 2`
* `list` +
`view 2` +
Views the 2nd person in the address book.
* `find Betsy`
`view 1`

* `find Betsy` +
`view 1` +
Views the 1st person in the results of the `find` command.

== View all details of a person : `viewall`

Displays all details (including private details) of the specified person.
Displays all details (including private details) of the specified person. +
Format: `viewall INDEX`

______________________________________________________________________
****
Views all details of the person at the specified `INDEX`.
The index refers to the index number shown in the most recent listing.
______________________________________________________________________
****

Examples:

* `list`
`viewall 2`
* `list` +
`viewall 2` +
Views all details of the 2nd person in the address book.
* `find Betsy`
`viewall 1`

* `find Betsy` +
`viewall 1` +
Views all details of the 1st person in the results of the `find` command.

== Clearing all entries : `clear`

Clears all entries from the address book.
Clears all entries from the address book. +
Format: `clear`

== Exiting the program : `exit`

Exits the program.
Exits the program. +
Format: `exit`

== 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. Address book data are saved in a file called `addressbook.txt` in the project root folder.

0 comments on commit 28ef63c

Please sign in to comment.