Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[T13-2]ForumBook #74

Open
wants to merge 465 commits into
base: master
Choose a base branch
from

Conversation

xllx1
Copy link

@xllx1 xllx1 commented Oct 11, 2018

No description provided.

@ewaldhew
Copy link

Comments for v1.2

AboutUs:

  • Naming convention for team photos not followed. Use your Github username in all lowercase and save as .png.

README:

  • Remove CS2113-specific info such as the link to Learning Outcomes

DeveloperGuide:

  • Good that the existing examples and diagrams are updated to your product name
  • 3.1: Should be CRUD not CURD, minor issue though 😅
  • 3.3.1: Design consideration briefly mentioned but no evaluation of alternative solutions like the existing ones.
  • 3.3.2: Some diagram could be useful here. How do these parts connect? What relationships have you defined between the different data?
  • 3.3.3: Also a possible place to put diagram/example. Decide where best to put to enhance your explanations.
  • 3.4: Need to add more details. Watch out for typos e.g. UnitOfWork becomes UnitOfWord.
  • Reminder: Each member must have at least one diagram/example in their description of implementation details for their feature.
    Maybe add class diagrams for specific new classes that are used in a feature, sequence diagrams to illustrate complicated flow of events, etc...

Copy link

@ewaldhew ewaldhew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall great work and generally clean code. Good job!

However, Model component has been cut out from the solution AFAICS. Correct me if I'm wrong. All the work is done in Storage instead, via the UnitOfWork class, which itself is a rather neat design IMO 👍
But in AB4 all the Add, Delete, etc. had been done with ModelManager, which then does the work of linking to the GUI to display stuff, and updating the storage, etc. (don't forget undo/redo)

In fact, I see underlyingStorage being used in Storage component. This was in the Model component!
Storage in AB4 only takes in data from Model and converts it into the storage format (XML), which is exactly what FileStorage.java in your project does. So the rest of the stuff above this layer can and probably should be moved back to Model.

All the best!


/**
*
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of these empty header comments (add just to satisfy checkstyle right 😆), don't forget to fill them in later on!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

*
*/
public interface IEvent {
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What might this be for? If it's to specify an event interface you could just extend from Java's existing Event

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay will take a look at Event

@@ -27,12 +28,12 @@
persons = new UniquePersonList();
}

public AddressBook() {}
public ForumBook() {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually after looking at the code, you guys completely skipped this layer of abstraction right? Data from commands is written directly to storage via the UnitOfWork interface.
ModelManager etc. are not being used anymore in your project right now AFAICS, but that shouldn't be the case. Have a look at how Model component wraps around the storage.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, for this, May I discuss with you about this? I've taken a brief look at ModelManager, this class defines what we can do with the data.
Eg:

  • We can add a Person to storage
  • We can update a Person to storage
  • We can check if a Person exists
  • We CANNOT directly check if a Person with a specific attribute exists

This is what I mean by defining the behaviour.

This is a good design in AddressBook case since there is only one entity to manage, Person.

However, in our case, we have more entities, Thread, Comment, User. To better manage the data, UnitOfWork is implemented to manage them, it does not directly manage the data, instead, there is another layer of abstraction EntityRepository, these repositories interface defines how we can interact with data.

Eg:

  • We can add Announcement
  • We can add User
  • We can get latest Announcement
  • We CANNOT directly get User by its password

This is preciously what model manager does. Yes, we are not currently using ModelManager, because I don't see it fit. If I modify ModelManager to wrap UnitOfWork, it will end up more than 20 methods managing Thread, Comment, User etc. entities. This is obviously not a good design (single responsibility?).

TLDR:
EntityRepository is somehow similar to ModelManager, UnitOfWork is an additional layer of abstraction which takes care of data consistency(commit, rollback) and manages EntityRepository.

I'm not sure if I got this correctly, do let me know what I can improve on this. Thanks a lot for your effort.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi good morning! @ewaldhew

HansKoh and others added 30 commits November 12, 2018 18:31
added UpdateCommentCommandTest
2) Developer Guide updated
3) User Guide Updated
4) User delete command done
updated sample data folder
updated DeveloperGuide and Ui
1) Added the PPP for E0191729
updated updateCommentCommand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants