Skip to content

Full review of code#3

Open
pzheltov wants to merge 8 commits into
emptyfrom
review
Open

Full review of code#3
pzheltov wants to merge 8 commits into
emptyfrom
review

Conversation

@pzheltov

@pzheltov pzheltov commented Jun 2, 2018

Copy link
Copy Markdown
Owner

No description provided.

Comment thread README.md

LIBRARY PROGRAM CRITERIA

X The topic of seminar work can be either individually chosen or according to the rules below.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

X is not valid Markdown, doesn't provide good structure to the README.

Comment thread README.md

CLASS STRUCTURE:

Overview of the int internalID in relation to classes and objects:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

remove int here

Comment thread src/Controls.java
FalseDatabaseStarter.startDatabase();


for (int i = 0; i < LibraryDatabase.getInventoryList().size(); i++) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Consider enhanced list iteration like so: for (E element : LibraryDatabase.getInventoryList()) { /* do stuff with element */ }. It's much better than get(i).

Comment thread src/Controls.java
}
}
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

remove extra newlines

@@ -0,0 +1,21 @@
Overview of the int internalID in relation to classes and objects:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

same typo as before: int.

}

public Inventory(int internalID, String type, String title, String availability) {
this.internalID = internalID;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

internalID and type are equivalent, right? each type corresponds to one internalID only? Moreover, the concrete implementation of this abstract class already carries this distinction as an instance of a concrete class.

Comment thread src/gui/AddItemBox.java

}

static void addTouristGuide() {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

there should definitely be a hierarchy of classes, where Novel, TouristGuide etc are concrete impls of a Book, etc.

this.availability = availability;
}

public abstract StringBuilder returnFinalInfo();

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

If you intend to add more to the returned FinalInfo, returning StringBuilder is fine, although the optimization that you get by using StringBuilder instead of String is completely irrelevant in your case: you are concatenating 20 strings at most.

I would imagine each of these two methods should return a string containing the info about the book. These are, effectively, public String toString() methods (don't forget to @Override). Add comments explaining what the difference between Raw and Final infos are.


public class ArchiveFootage extends Video {
private boolean regionalHistory;
private boolean propaganda;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

:)

Comment thread src/Controls.java

import inventory.FalseDatabaseStarter;
import inventory.Inventory;
import inventory.LibraryDatabase;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

folder structure does not correspond to the package structure. Follow IntelliJ recommendations to move packages around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants