This week's book giveaway is in the NodeJS forum. We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line! See this thread for details.
* Sort/segregate students on the basis of various criterias.
* Right now, we will be sorting on the basis of students age but in future different kind of sorting requirements may come.
* Future requirements can be any like sort students on the basis of their father’s age, segregate students on the basis of grades they got etc.
* For all the sorting/segregation types, list of students objects will be provided.
* Create a reusable framework which can be used for age based sorting & future sorting requirements which may come.
We don't supply complete solutions, but you doubtless know about sorting with Comparators. You can use the decorator pattern to create comparators using multiple criteria, and you might use a strategy pattern to decide which Comparator to use just now. I presume you are familiar with the theory of sorting; I like this part of the Java™ Tutorials.
posted 4 months ago
Thanks Campbell for your kind help. I have done some research on both the suggested patterns & looks like Decorator pattern will fit in my requirements.
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
global solutions you can do at home or in your backyard