ucsb-cs56-w20 / ucsb-courses-search

Spring Boot App to show similar information to that found at UCSB Curriculum Search page
https://ucsb-courses-search.herokuapp.com
2 stars 5 forks source link

Model/Service Objects for Building Codes #181

Closed pconrad closed 4 years ago

pconrad commented 4 years ago

As a developer, I can call a method where I pass in a UCSB Building Code, and I get back a UCSBBuilding Object which has getters for buildingCode, buildingName, latitude, and longitude.

There should be a plain old java object (under models) that encapsulates a UCSBBuilding. There could be a UCSBBuildingService as well that, given a building code, will look up that building (either in a static table, or an API, or whereever---that part is encapsulated) and returns a UCSBBuilding object.

Bryan Terce can supply that data needed to build that service. It might be as simple as putting that file under resources/data/ucsb_buildings.json, and then using Java code that opens that file from the resources directory (using methods from the classpath, rather than file system methods... those tend to not work on Heroku).

Or the data could be converted to Java array literal notation... there are a number of ways of doing it.

connormcintosh commented 4 years ago

The process for starting would be to, on a new branch, create the file UCSBBuilding.java under the model folder that imports the API with all the building codes. The Building object would have an instance variable that would be the building code and maybe other information that we would need for calculating the distance between buildings later on.