Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKenneth G.
Courses Plus Student 1,171 PointsJava design Directory
How can i design this directory app?
Im trying to design a directory app with rest api. This is the scenario:
public abstract class Spot{
protected Long id;
protected String name;
protected Address address;
protected List<String> categories;
}
public class Restaurant extends Spot{
private boolean hasValet;
private boolean canReserve;
private boolean hasVeganFood;
...
}
public class Beach extends Spot{
private boolean hasParkin;
private boolean canCamp;
private List<Spot> hotelsNear;
...
}
if i wanted to do this with Spring Framework and spring rest Api, do i need to create a controller and endpoints for each one of the classes that inherits from the Spot class?