Skip to content

Commit

Permalink
Merge pull request #148 from zhuhanming/dev-guide-init
Browse files Browse the repository at this point in the history
Dev guide init
  • Loading branch information
JingYuOng committed Apr 13, 2020
2 parents d30c486 + adb95cf commit 8d8ccca
Show file tree
Hide file tree
Showing 32 changed files with 468 additions and 106 deletions.
4 changes: 2 additions & 2 deletions docs/DevOps.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ See <<UsingNetlify#, UsingNetlify.adoc>> for more details.

Here are the steps to create a new release.

. Update the version number in link:{repoURL}/src/main/java/seedu/address/MainApp.java[`MainApp.java`].
. Update the version number in link:{repoURL}/src/main/java/modulo/MainApp.java[`MainApp.java`].
. Generate a JAR file <<UsingGradle#creating-the-jar-file, using Gradle>>.
. Tag the repo with the version number. e.g. `v0.1`
. https://help.github.com/articles/creating-releases/[Create a new release using GitHub] and upload the JAR file you created.

== Managing Dependencies

A project often depends on third-party libraries.
For example, Address Book depends on the https://github.com/FasterXML/jackson[Jackson library] for JSON parsing.
For example, Modulo depends on the https://github.com/FasterXML/jackson[Jackson library] for JSON parsing.
Managing these _dependencies_ can be automated using Gradle.
For example, Gradle can download the dependencies automatically, which is better than these alternatives:

Expand Down
241 changes: 178 additions & 63 deletions docs/DeveloperGuide.adoc

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/LearningOutcomes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ Note how the `Command::execute()` method shows polymorphic behavior.
=== Exercise: Add a polymorphic `isMutating` method

* Add a method `boolean isMutating()` to the `Command` class.
This method will return `true` for command types that mutate the data. e.g. `AddCommand`
* Currently, AddressBook data are saved to the file after every command.
This method will return `true` for command types that mutate the data. e.g. `AddModuleCommand`
* Currently, Modulo data are saved to the file after every command.
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.
i.e. `module` command should always save the data while `list` command should never save data to the file.

[NOTE]
====
Expand Down
15 changes: 14 additions & 1 deletion docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window.
Refer to <<Features>> for details of each command.
Note: We highly recommend going through the <<Tutorial,tutorial>> before starting!

// tag::tutorial[]
[[Tutorial]]
== Tutorial

Expand Down Expand Up @@ -164,6 +165,8 @@ For that, our commands have variations that do not depend on the <<Focused,*focu

Want to find out more?
Head over to <<Features>> now!
// end::tutorial[]


[[Features]]
== Features
Expand All @@ -185,6 +188,7 @@ Format: `help`

image::HelpWindow.png[width="790"]

// tag::addmodule[]
=== Adding a module: `module` (Multistep)

Adds a module for AY 19/20 Sem 2 to Modulo. +
Expand Down Expand Up @@ -212,7 +216,9 @@ image::SamplePrompt1.png[width="500"]
You may have to restart the process by deleting the module and re-adding it.
Do see the section on <<Delete,deleting a module>> below.
*****
// end::addmodule[]

// tag::addevent[]
=== Adding an event: `event`

Adds a custom event to a module.
Expand Down Expand Up @@ -252,7 +258,9 @@ You can view the full list of event types <<EventTypes,here>>.
==== Pro-tip (GUI-dependent)

If you're already viewing a module (i.e. <<Focused,focused>> on a module), you can actually drop the `m/MODULE_CODE`!
// end::addevent[]

// tag::adddeadline[]
[[AddingDeadline]]
=== Adding a deadline: `deadline`

Expand All @@ -275,6 +283,7 @@ This is to prevent the creation of irrelevant deadlines for unrecognised types o

If you're already viewing an event (i.e. <<Focused,focused>> on an event), you can actually drop the `m/MODULE_CODE`
AND the `e/EVENT_NAME`!
// end::adddeadline[]

[[List]]
=== Listing events or modules on the left: `list`
Expand Down Expand Up @@ -390,7 +399,7 @@ Deletes a module, event, or deadline by its index, a search term, or delete all.

==== Deleting Modules and Events

Format: `delete INDEX` OR `delete SEARCH TERM` OR `delete all`
Format: `delete INDEX` OR `delete SEARCH_TERM` OR `delete all`

Things to note:

Expand Down Expand Up @@ -453,6 +462,7 @@ _{explain how the user can edit an added Event or Deadline}_

_{explain how the user can import a NUSMods Calendar}_

// tag::ui[]
== UI

*****
Expand Down Expand Up @@ -513,6 +523,7 @@ This status bar displays where your data is being saved at.
You can head over to that folder to find the `.json` file for your usage.

Your exported `modulo.ics` will also be found in the same directory, unless otherwise specified when exporting.
// end::ui[]

== FAQ

Expand All @@ -532,6 +543,7 @@ Stay Tuned!
*A*: Unfortunately for now, Modulo is only catered to NUS students.
For other universities, feel free to reach out to our team to discuss a possible collaboration!

// tag::appendix[]
== Appendix

[[EventTypes]]
Expand All @@ -550,3 +562,4 @@ Recognised official event types are:
* Packaged Lecture
* Tutorial Type Two
* Design Lecture
// end::appendix[]
20 changes: 20 additions & 0 deletions docs/diagrams/AddModuleHasStateSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddModuleStatefulLogicManager" as AddModuleStatefulLogicManager LOGIC_COLOR
participant ":ModuloParser" as ModuloParser LOGIC_COLOR
end box

[-> LogicManager : execute("D09")
activate LogicManager
activate AddModuleStatefulLogicManager
alt AddModuleStatefulLogicManager has state
LogicManager -> AddModuleStatefulLogicManager : execute("D09")

else else
LogicManager -> ModuloParser : parseCommand("D09")
activate ModuloParser
end
@enduml
73 changes: 73 additions & 0 deletions docs/diagrams/AddModuleOverviewSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ModuloParser" as ModuloParser LOGIC_COLOR
participant ":AddModuleCommandParser" as AddModuleCommandParser LOGIC_COLOR
participant "a:AddModuleCommand" as AddModuleCommand LOGIC_COLOR
participant "result:AddModuleCommandResult" as AddModuleCommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("module m/CS2103")
activate LogicManager

LogicManager -> ModuloParser : parseCommand("module m/CS2103")
activate ModuloParser

create AddModuleCommandParser
ModuloParser -> AddModuleCommandParser
activate AddModuleCommandParser

AddModuleCommandParser --> ModuloParser
deactivate AddModuleCommandParser

ModuloParser -> AddModuleCommandParser : parse("m/CS2103")
activate AddModuleCommandParser

create AddModuleCommand
AddModuleCommandParser -> AddModuleCommand
activate AddModuleCommand

AddModuleCommand --> AddModuleCommandParser : a
deactivate AddModuleCommand

AddModuleCommandParser --> ModuloParser : a
deactivate AddModuleCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
AddModuleCommandParser -[hidden]-> ModuloParser
destroy AddModuleCommandParser

ModuloParser --> LogicManager : a
deactivate ModuloParser

LogicManager -> AddModuleCommand : execute()
activate AddModuleCommand

group State Preparation
AddModuleCommand -> Model : addModule("CS2103")
activate Model

Model --> AddModuleCommand
deactivate Model

create AddModuleCommandResult
AddModuleCommand -> AddModuleCommandResult
activate AddModuleCommandResult

AddModuleCommandResult --> AddModuleCommand
deactivate AddModuleCommandResult
end

group State Loading
AddModuleCommand --> LogicManager : result
deactivate AddModuleCommand
end

[<--LogicManager
deactivate LogicManager
@enduml
25 changes: 25 additions & 0 deletions docs/diagrams/MultipleHasStateSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddModuleStatefulLogicManager" as AddModuleStatefulLogicManager LOGIC_COLOR
participant ":XStatefulLogicManager" as XStatefulLogicManager LOGIC_COLOR
participant ":ModuloParser" as ModuloParser LOGIC_COLOR
end box

[-> LogicManager : execute("D09")
activate LogicManager
activate AddModuleStatefulLogicManager

alt AddModuleStatefulLogicManager has state
LogicManager -> AddModuleStatefulLogicManager : execute("D09")

else XStatefulLogicManager has state
LogicManager -> XStatefulLogicManager : execute("D09")

else else
LogicManager -> ModuloParser : parseCommand("D09")
activate ModuloParser
end
@enduml
36 changes: 36 additions & 0 deletions docs/diagrams/StateLoadingSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant "a:AddModuleCommand" as AddModuleCommand LOGIC_COLOR
participant "result:AddModuleCommandResult" as AddModuleCommandResult LOGIC_COLOR
participant ":AddModuleStatefulLogicManager" as AddModuleStatefulLogicManager LOGIC_COLOR
end box

activate AddModuleCommand
activate LogicManager
activate AddModuleStatefulLogicManager

create AddModuleCommandResult
AddModuleCommand -> AddModuleCommandResult
activate AddModuleCommandResult

AddModuleCommandResult --> AddModuleCommand
deactivate AddModuleCommandResult

group State Loading
AddModuleCommand --> LogicManager : result
deactivate AddModuleCommand

opt result instanceof AddModuleCommandResult
LogicManager -> AddModuleStatefulLogicManager: setStateWithCommandResult(result)
AddModuleStatefulLogicManager --> LogicManager

end
end

[<--LogicManager
deactivate AddModuleStatefulLogicManager
deactivate LogicManager
@enduml
41 changes: 41 additions & 0 deletions docs/diagrams/StatePreparationSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant "a:AddModuleCommand" as AddModuleCommand LOGIC_COLOR
participant "result:AddModuleCommandResult" as AddModuleCommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant ":ModuleLibrary" as ModuleLibrary MODEL_COLOR
end box

activate AddModuleCommand

group State Preparation
AddModuleCommand -> Model : addModule(moduleCode, academicYear)
activate Model

Model --> AddModuleCommand
deactivate Model

AddModuleCommand -> Model: getModule(moduleCode, academicYear)
activate Model
Model --> AddModuleCommand: module: Module
deactivate Model

AddModuleCommand -> ModuleLibrary: getEventTypesOfModule(module)
activate ModuleLibrary
ModuleLibrary --> AddModuleCommand: eventTypes: List<EventType>
note left: eventTypes will later\nserve as the state
deactivate ModuleLibrary

create AddModuleCommandResult
AddModuleCommand -> AddModuleCommandResult: module, eventTypes
activate AddModuleCommandResult

AddModuleCommandResult --> AddModuleCommand
deactivate AddModuleCommandResult
end
@enduml
34 changes: 34 additions & 0 deletions docs/diagrams/StatefulLogicClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@startuml
!include style.puml
show members
skinparam classAttributeFontColor #FFFFFFF
skinparam classAttributeIconSize 0
skinparam arrowThickness 1.1
skinparam arrowColor LOGIC_COLOR_T4
skinparam classBackgroundColor LOGIC_COLOR

Package StatefulLogic {

class StatefulLogic <<interface>> {
+hasState(): boolean
+setStateWithCommandResult(commandResult: CommandResult): void
+execute(commandText: String): CommandResult
}

class AddModuleStatefulLogicManager {
-module: Module
}

AddModuleStatefulLogicManager .up.|> StatefulLogic
}

Package Model {
hide members
class EventType <<enumeration>> MODEL_COLOR
class Model MODEL_COLOR
}

AddModuleStatefulLogicManager "1"-right->"1" Model
AddModuleStatefulLogicManager "1"-right-> "*" EventType

@enduml
6 changes: 3 additions & 3 deletions docs/diagrams/UndoRedoState0.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ skinparam ClassBorderColor #000000
title Initial state

package States {
class State1 as "__ab0:AddressBook__"
class State2 as "__ab1:AddressBook__"
class State3 as "__ab2:AddressBook__"
class State1 as "__m0:Modulo__"
class State2 as "__m1:Modulo__"
class State3 as "__m2:Modulo__"
}
State1 -[hidden]right-> State2
State2 -[hidden]right-> State3
Expand Down
6 changes: 3 additions & 3 deletions docs/diagrams/UndoRedoState1.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ skinparam ClassBorderColor #000000
title After command "delete 5"

package States <<rectangle>> {
class State1 as "__ab0:AddressBook__"
class State2 as "__ab1:AddressBook__"
class State3 as "__ab2:AddressBook__"
class State1 as "__m0:Modulo__"
class State2 as "__m1:Modulo__"
class State3 as "__m2:Modulo__"
}

State1 -[hidden]right-> State2
Expand Down
Loading

0 comments on commit 8d8ccca

Please sign in to comment.