GithubHelp home page GithubHelp logo

course-project-aarves's People

Contributors

ashenafee avatar erica27 avatar github-classroom[bot] avatar lanthony42 avatar onatsyy avatar rebplane avatar vt111 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

course-project-aarves's Issues

User Interface and Clean Architecture

So we have to decide how the architecture will work for the UI. I'm not too familiar with the Android framework, but it seems it is naturally (sort of) in line with the MVVM pattern. However, I'm pretty sure we are expect to make both Presenters and Controllers for this project. Making a Presenter in a way similar to the MVP pattern is straightforward, and it can be combined with ViewModels pretty easily. The problem is Controllers aren't as natural in Android, since Activities have both Controller-like and View-like properties. The solution might be to delegate inputs to Controller classes or something similar.

Any other thoughts?

Purpose of Entities

What is the point of entities if we have data persistence? How will we distinguish entities from DTOs from data persistence (i.e. what can entities do which won't be stored in a database)? Are entities basically just in-memory data storage for convenience more than anything?

Review creates duplicate reviewID upon deletion from reviews

After removing a review from reviews, the size of the list shrinks.

Example:
So, say reviews has 5 items with reviewIDs 1, 2, 3, 4, 5.

If review with reviewID 3 is deleted from reviews, then the size would be 4.

Adding one more review will increase the size to 5, then now there are two reviews with ID 5.

Location get_avgrating divides by zero if the location has no reviews

It is called in Location's toString, so this may cause issues since there is no check for zero division either before the call or in the method get_avgrating.

We may want to give a Location with 0 reviews an average rating of -1, and in the toString, add a check for == -1, and if that is the case, say "This location has no reviews yet."

Shortcuts Used in New Implementations.

  • Bookmarks will not be implemented for Phase 1
  • Deleting a User does nothing to the User's Reviews
  • AccountDataImpl uses ReviewRepositoryImpl, which is bad!
  • Not very prepared for a "view other accounts" feature (due to password storage)
  • Used AppDatabase on main thread - maybe look into async for Phase 2

Data Persistence and Clean Architecture

Here are some of my thoughts regarding the current state of our data persistence system, and some Clean Architecture related issues.
First, here is an approximate diagram for the current implementation. Note that I put ReviewList in the use cases layer, since apparently Maps are use cases.

current_database_system

One apparent problem would be that the ReviewSerializer must be on the lowest level since it directly uses GSON to store data, which presents a problem since it depends on a use case. This might not necessarily be an issue because in reality Clean Architecture is never mentioned to be a strict layered architecture, though the course slides say so (so which should we follow?). The more pressing issue is that, according to the book:

The important thing is that isolated, simple data structures are passed across the boundaries. We don’t want to cheat and pass Entity objects or database rows.

What we are doing is basically passing a use case which contains entities across boundaries which is probably an even more severe form of 'cheating'. However, many data persistence frameworks do this, where entities are directly referred to for persistence purposes, at least for the newer frameworks I think. Even in the following picture from the book:

image

The DataAccessInterface depends on entities, which means its concretion in the outermost layer would probably need to as well? Some ideas are as follows:

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.