This site is from a past semester! The current version will be here when the new semester starts.

iP: Week 2iP: Week 4


iP: Week 3

  1. Do any leftover iP tasks from the previous week
  2. Create a PR to the upstream repo
  3. Add Increments as parallel branches: Level-7, Level-8
  4. Add Increments: A-MoreOOP, A-Packages, A-JUnit, A-Jar
  5. Add Increments as parallel branches: A-JavaDoc, A-CodingStandard, Level-9

Reminder about the deadline for the weekly project tasks:

1 Do any leftover iP tasks from the previous week

  • Remember to do any leftover increments from the past weeks before starting on the current week's increments. This guideline applies to future weeks too.

2 Create a PR to the upstream repo

  • Create a pull request (PR) from your fork to the upstream repo. Note the following:
    • Create the PR from the master branch of your fork to the master branch of the upstream repo (https://github.com/nus-cs2103-AY2122S1/ip)
    • Set the PR name as [{Your name}] iP e.g., [John Doe] iP If you are reluctant to give full name, you may give the first half of your name only.
      You may leave the description as empty.
    • If you created the PR correctly, it should appear in the list of PRs here.
    • Steps for creating a PR is given in this textbook topic (steps 5 onwards):

The PR will update automatically to reflect your latest code every time you push code to your fork. As a result, it provides a convenient way for us to access the current state of all your iP code from one location.

3 Add Increments as parallel branches: Level-7, Level-8

  • Do Level 7 in a branch named branch-Level-7. Without merging that branch, go back to the master branch and implement the other increment in a separate branch named similar to the first (i.e., branch-{increment ID}). Now, go back to the master branch and merge the two branches one after the other. As before, tag the commit (in the master branch, after merging) that achieves the respective deliverable, and push to your fork.
    Remember to push the branches to your fork so that the grading script can detect them.
    Only merged branches are detected by the script. After merging a branch b1 to the master branch, you need to push both the master and the b1 branches to the fork. Pushing the master branch does not automatically take the b1 branch along with it just because it is already merged to the master branch.
    Advanced git users: do not delete the branch after merging.
    Merge without a fast-forward so that git creates a separate commit for the merge.
Duke Level-7: Save

Duke Level-8: Dates and Times

4 Add Increments: A-MoreOOP, A-Packages, A-JUnit, A-Jar

Why more OOP?

One of the increments below asks you to push the design more towards the OOP approach. This is a good point to remind you that OOP is not a silver bullet or always the right choice. While it is the most widely used and possibly the right choice for a variety of situations, it may not work well for other situations, and it has plenty of detractors and known problems.

OOP has been chosen as the primary paradigm for this module and you are expected to try to push it to its limits. That should give you a first-hand experience of OOP's strengths and weaknesses. Furthermore, OOP (or any other paradigm) will appear worse than it really is if not used correctly, and learning to use it correctly in increasingly larger systems is another objective you can aim for in this module. As you do the tP later, you'll also realize that while OOP is used for the internal design of its components, the higher-level design is not specifically an OOP one.

We do not prohibit the use of other paradigms, however. For example, if you find a place where the functional approach is better, go ahead and use it. As you know, Java supports functional programming to a certain extent. In fact, the tP code given to you uses small snippets of functional-style code in several places.

Good OOP != OOP is good: While the module pushes you to use good OOP, do not interpret it as a message of OOP is good; it's good for some cases and not so for other cases. The best is usually a combination of approaches. Hence, you are encouraged to get better at other paradigms, the functional paradigm in particular which has been rising in popularity in some areas such as big data, AI, parallel systems.
That said, it is also preferable to use one paradigm as the primary approach and fallback on others only when the primary paradigm is clearly sub-optimal. Reason: mixing everything in equal measures might make the system even harder to understand.

  • As in the previous week, commit, tag, and push, as you do the following increments in the master branch (no need to use separate branches).
Duke A-MoreOOP: Use More OOP

Duke A-Packages: Organize into Packages

Duke A-JUnit: Add JUnit Tests

Duke A-Jar: Create a JAR File

5 Add Increments as parallel branches: A-JavaDoc, A-CodingStandard, Level-9

  • As in the step 1 above, implement these three increments as three parallel branches first (branch names: branch-A-JavaDoc, branch-A-CodingStandard, branch-Level-9), and then merge them one-by-one. Hopefully, you will encounter some merge conflicts so that you get to practice de-conflicting branches.
  • The Java and Git standards to follow (for A-CodingStandard) are given in this page.
  • After finishing, assuming you encountered merge conflicts (and some were rather painful to resolve), think of how such conflicts could have been reduced (e.g., by changing the order of merging, or minimizing parallel branches when certain type of changes are being done to the code).
Duke A-JavaDoc: JavaDoc

Duke A-CodingStandard: Follow the Coding Standard

Duke Level-9: Find


iP: Week 2iP: Week 4