I am in the process of creating a library for the teachers' timetable.
But I was wondering if I should put a class in @Deprecated or not.
Here is the case in which I am:
In the library, I have a Schedule
class that collects the schedules from the school website.
And another ScheduleProxy
class keeps in the cache the requests already made, thus avoiding the same request a second time.
/**
*
* @deprecated For the use of the Schedule class, it is preferable
* to use its proxy: {@link ScheduleProxy} in order to have better response times.
*
* @see InterfaceSchedule
* @see ScheduleProxy
*/
@Deprecated(forRemoval = false)
public final class Schedule implements InterfaceSchedule {
/*
* Code
*
*/
}
public final class ScheduleProxy implements InterfaceSchedule{
/*
* Code
*
*/
}
I changed the public to private package the Schedule
class so the user doesn't use this class.
/**
*
* @see InterfaceSchedule
* @see Schedule
*/
final class ConcreteSchedule implements InterfaceSchedule {
/*
* Code
*
*/
}
I changed the class name from "ScheduleProxy" to "Schedule" so that it would make it clearer to the library user.
public final class Schedule implements InterfaceSchedule{
/*
* Code
*
*/
}
So I wanted to ask you which of the two solutions is better to use?
The second solution is more intuitive to the user and makes it impossible to use an API you actually don't want to be used. I'd say it's better.