Click here to Skip to main content
15,888,908 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Requirements - 
* 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.


What I have tried:

I am thinking to Factory design pattern
Posted
Updated 1-Dec-18 23:20pm
v2

The Decorator [^] pattern may be appropriate but some have suggested the Strategy[^] pattern.

Here is an example of what you are trying to do - https://thispointer.com/strategy-design-pattern/[^] - be aware that your tutor will be familiar with that article.

The links at the top of this post are from .NET Design Patterns in C# and VB.NET - Gang of Four (GOF) - doFactory.com[^]. I have no affiliations with DoFactory
 
Share this answer
 
Thanks for your kind help. I have done some research on both the suggested patterns & looks like Decorator pattern will fit in my requirements.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900