Coder Social home page Coder Social logo

se-edu / addressbook-level25 Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 1.0K 923 KB

:ab::three: Address Book sample application (Level 2.5)

Home Page: https://se-edu.github.io/addressbook-level25

License: MIT License

Java 98.51% CSS 0.32% Shell 1.16%
education java javafx students

addressbook-level25's Introduction

SE-EDU

SE-EDU (se-education.org) is a collection of FOSS resources for Software Engineering (SE) educators and students. The full website is available at https://se-education.org

addressbook-level25's People

Contributors

alexlmeow avatar damithc avatar donjar avatar eugenepeh avatar fzdy1914 avatar jia1 avatar louietyj avatar mightycupcakes avatar okkhoy avatar pyokagan avatar weikangchia avatar yamgent avatar yamidark avatar yl-coder avatar zzzzwen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

addressbook-level25's Issues

404 error for doc links in README

The relative links of "Useful Links" in the README are successfully replaced when viewed alone, doc/UserGuide.md becomes https://github.com/se-edu/addressbook-level3/blob/master/doc/UserGuide.md, which is correct.

However when viewed from the repo's main page, doc/UserGuide.md becomes https://github.com/se-edu/doc/UserGuide.md, which results in a 404 Not Found error

Can anyone else confirm this behavior? It appears that addressbook-level2 also has this issue. Other repos are behaving normally, such as HubTurbo.

Add logging

Add logging, preferably with a rolling log file.
Perhaps limit to a few levels: DEBUG, INFO, WARNING, ERROR?

Clumping all things missing in AB-3 as compared to AB-4 in one issue

Based on the list given by my student Tek In ( @0WN463 ) these are the things missing in AB-3 as compared to AB-4

  • Checkstyle: config file is not the repo
  • Travis/Gradle: Present, but documentation is absent.
  • Coverall/Appveyor/Codacy/Auto publishing: No additional files needed to add (except maybe appveyor.yml) as mostly is set up on their site, but documentation is absent. Also, travis.yml/build.gradle may be outdated with respect to these.
  • Folder structure is different between AB-3 and AB-4 which causes a minor inconvenience while using reposense scripts.

Please feel free to close this issue or mark as duplicate if these items are already recorded and being addressed.

Allow user to change the save location through command line parameters

Our application always saves to addressbook.txt.

User might want to have more than one address book. We need a way for the user to change the save location.

Let's implement a feature whereby the user is able to change the save location by passing in a command line parameter. For example, the user can execute java seedu.addressbook.Main mynewbook.txt in the command line. The application will then save the address book content inside mynewbook.txt instead of addressbook.txt.

Implementation details:

  • Use Application.getParameters() to obtain the command line parameter that the user may have typed in.
  • Pass this input to StorageFile#StorageFile(String filePath).

data/ in .gitignore cause changes to seedu.addressbook.data package to be ignored

To reproduce:

  • Open a terminal in the src/seedu/addressbook/data folder
  • touch test to create a new file
  • git status - notice git did not track the newly created file

This is caused by the data/ line in the .gitignore file. If the intention was to ignore the data directory at the root, /data/ should be used instead. In addition, if this was a file local only to a single developer, it might be better to add it to .git/info/exclude instead

executable jar file doesn't run

Some students have reported that the executable jar file created by eclipse doesn't run on Windows but runs on Mac. The app runs within the IDE though.

Add a data summary to the UI

We can show details such as total persons and existing tags somewhere in the GUI.

The GUI can be made a bit more sophisticated anyway. The current one is too simple.

Set up Travis CI

Although it is not a learning outcome of this level, we can still set up for the convenience of developers and contributors.

Set up coveralls reporting

Although it is not a learning outcome of this level, we can still set up for the convenience of developers and contributors.

If StorageStub.save() does nothing, test cases will fail

From LearningOutcomes.md:

  • Implement the StorageStub such that calls to the save method do nothing (i.e. empty method body).

Since some of the test cases uses a non-empty AddressBook, LogicTest.assertCommandBehavior(...) will try to compare the expected non-empty AddressBook, with the AddressBook 'residing' on the storage (which is empty since the method does not attempt to retain the content in any way), resulting in failing test cases.

Please advise.

Logic is not closed for modification

In the current implementation, logic is calling initializeStorage() method which creates the storage file object. For LO-DIP and later LO-OCP we explain the following:
Using DIP and making StorageFile extend Storage helps OCP as well, because, we can pass any object that is Storage and logic should pick it up.
As long as initializeStorage() is creating the correct type of storage object inside Logic, logic is not closed for modification.
I suggest we move creating the storage object to MainWindow and call Logic::setStorage from there to set the underlying storage.

Make package/directory structure similar to Level 4

While the directory/package structure does not have to be exactly the same, it is still beneficial for the overall project if they are as similar to each other as possible to ease porting of code from one level to another.

Directory structure

Making them the same would allow us to share the build.gradle file between levels (for e.g. CI )

  • Main sources should be moved to src/main/java.

  • Test sources should be moved to src/test/java.

Package naming

Having consistent package names will make it easier to port code from one level to another. It will also make it clear that different levels build upon each other.

  • seedu.addressbook should be renamed to seedu.address.

    • Main should be renamed to MainApp.
  • seedu.addressbook.common should be renamed to seedu.address.commons.

  • seedu.addressbook.data should be renamed to seedu.address.model.

  • seedu.addressbook.data.exception should be renamed to seedu.address.commons.exceptions.

  • seedu.addressbook.commands should be renamed to seedu.address.logic.commands.

  • seedu.addressbook.parser should be renamed to seedu.address.logic.parser.

Add a gradle task for building the project into a jar file

Some students use AB-3 as the basis for their project. They need a gradle task to build their product as a jar file.

Fix suggested by @pyokagan

diff --git a/build.gradle b/build.gradle
index 0a42902..255ef06 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,8 +7,13 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
 plugins {
     id 'java'
     id 'org.asciidoctor.convert' version '1.5.6'
+    id 'com.github.johnrengelman.shadow' version '2.0.3'
+    id 'application'
 }

+// Specifies the entry point of the application
+mainClassName = 'seedu.addressbook.Main'
+
 sourceCompatibility = JavaVersion.VERSION_1_9
 targetCompatibility = JavaVersion.VERSION_1_9

@@ -41,6 +46,12 @@ dependencies {
     testImplementation group: 'junit', name: 'junit', version: '4.12'
 }

+shadowJar {
+    archiveName = 'addressbook.jar'
+
+    destinationDir = file("${buildDir}/jar/")
+}
+
 task wrapper(type: Wrapper) {
     gradleVersion = '4.8.1'
 }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.