I am developing an application where as a background i need to monitor the user activity on particular objects and later when they are visualized they need to be sorted based on the order of which the user used them ( the last used object must be visualized on the first row of a grid for example.)
So if i have an Arraylist where i store the objects which the user is dealing with in order to add the last used object i need to check if it is already in the list and then move it at the first position. If the object is not there i simply add it at the first position of the list.
So instead of doing all these steps i want to make my own list where the logic exlained above will be available.
And finally my question is (hopefully it is not opinion based) which scenario is better:
- Implement the list interface
- Extend the ArrayList class and override the ADD method
10x in advance.