Code Monkey home page Code Monkey logo

nusports's People

Contributors

ptrteixeira avatar

Watchers

 avatar

nusports's Issues

Changing tabs doesn't make query

Changing tabs doesn't automatically make a query to the website, even when it should.
Steps to reproduce:

  1. Open application.
  2. Switch tabs. Table will be blank.
  3. Hit reload. Table will populate.

Preserve selected sport when switching tabs

At the moment, the selected sport is handled independently by each tab. This means that each tab remembers what you were on, rather than being preserved when switching between the two of them. In my opinion, it would be a better UX for selected sport to be preserved between tabs (eg, you are looking at Volleyball's current standings, and then you switch tabs to check out what games they have left to play).

Use alternate test framework

Currently uses JUnit 4 + Hamcrest + TestFX 4.

TestFX 4 stays because its good for what it does. I am still not going to try to get it to work in headless mode, though.

If possible, it would be fun to get it running with JUnit 5, which is (as of this issue) in early alpha. It might be fun to get it running with j8spec, a BDD-style test library, which is built to inter-operate with JUnit (4?), so prob'ly would work together fine. Maybe also drop in AssertJ, which is (+/-) an alternative to Hamcrest.

Discover web scrapers at run time

Ideally, this application could be used to gather the statistics that it covers from pretty much anywhere. In order to do that, it should load web scrapers via the ServiceLoader API, so that you can easily swap it out for different websites.

Bump Gradle version to 3.0

Update to the newest version of Gradle. The fix for this issue should probably involve at least trying out rewriting some of the gradle scripts for this project as Kotlin gradle scripts.

Rx for async

At the moment, I am starting a new thread, performing the request there, and eventually pushing that onto the UI. This isn't hella fun because JavaFX is finicky about threading, and because threads are, all things considered, a pretty low-level abstraction for asynchronous programming. So I would rather move to something else.

I'm not really concerned whether it is ReactiveX and its handful of derivatives on the platform or it's Kotlin's coroutines, or anything like that. I'd just like to not have to start my own threads.

Strip out exceptions

See the description w/r/t F#. The idea is that you pass an Either<Exception, Value> around and map/flatMap over that, rather throwing exceptions and no longer having a single point of return. Is it necessary? Probably not. Is it cool? Yeah, which is why I'm going to do it.

Provide stronger typing guarantees w/r/t supported sports

At the moment, communication between the model and the controller - and even within the model - regarding sports is entirely with strings. This is abominable, frankly, because it means there's a bunch of expressions that are just switches over strings.

At least within the model, I should move to using an enum. The advantage of this is that I can then centralize the switch-over-string functions into the enum.

I am unsure whether I should an interface-over-enum setup for communication between the model and the controller. I think it is probably more likely to complicate the interface unnecessarily and I am unsure that the controller has a need to look at individual sports. I could be wrong, though, so I need to think about this.

Add more build artifacts to CircleCI

At the moment, the build artifacts being exported to CircleCI are the HTML style check output and the XML test output. I would like to at least also include the HTML test output. An ever-so-slightly more ambitious goal is to add code coverage metrics as well; this would involve adding another plugin to the Gradle build script.

Allow controller to support multiple web scrapers

The controller should be able to make use of multiple web scrapers. The particular use case for this is that some of Northeastern's sports are through the CAA and some are through the Hockey East. Currently, this application only works on the CAA web-site, and therefore can only provide access to the sports that are through the CAA. It would be really nice if it could also work for the Hockey East website.

This should be pretty easy. The key idea is that the controller should be able to look up a web scraper based on a sport, then perform the required calls.

Table does not include overall standings column

The standings table contains three columns, but they are not the correct three columns. One of the columns is labeled "Result" and doesn't contain anything. It should be labeled "Overall" and contain the overall win-loss record for the team.

Parse RSS feed for schedule instead of webpage

At the moment, it currently takes ~ 2 minutes for the full calendar to load on the CAA website. That's way, way too slow to be usable, quite honestly. Loading the RSS feed, on the other hand, is nice and snappy. So that's what I'm gonna use instead.

Put query to website onto separate thread

At the moment, the JSoup query is blocking things on the UI thread, which is creating a pretty bad UX - the application pauses while the web request does it's thing. The best way to resolve this would be to make something here an observable and just pull that through. The less preferred way would be to make the response a promise. The least preferred way would be to put the request on a new thread and pull them back together later.

Introduce Dependency Injection

The object between the model and the controller is pretty small, but it still isn't terribly fun to be creating it in a bunch of different places. It would also encourage better design - or, at least, slightly better inversion of control for testing.

Possible frameworks for dependency injection:

  • Dagger 2
  • Guice
  • others ?

Minimize the size of the HTML test files

The test files that are checked in as samples at the moment are massive, and are causing this project (which is definitely actually written in Java) to be detected as HTML. This is unfortunate.

Most of the content of those HTML files does not need to be their. As a matter of fact, it should almost certainly be just-barely-valid HTML plus a table. Anything else is more of a test of JSoup than this project. (There are hypothetical legal issues behind this decision too).

Migrate UI over to JavaFX XML

At the moment, all of the UI code is written in Java. This isn't a terribly good way to do it, because it makes the UI difficult to understand. It also isn't terribly well supported by JavaFX itself; at the moment, the controller controls by asking if the view would kindly register these lambdas on the relevant objects, please. The correct way to do this would be to put the layout code in xml and rely in JavaFX's native view injection to put the references in the right spots.

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.