jeudi 23 novembre 2017

generic method with type argument vs creating independent methods

I am having a scenario where

  1. A user creates a page.
  2. User send the page for reviews.
  3. We have multiple types of review like global, regional and translation review.

I am already having a page model.

So at page model i should write one method like get_reviews with a type parameter

Vs

i should define 3 individual methods like get_global_reviews, get_regional_reviews, get_translation_reviews.

I do not have much knowledge on design patterns. I just want some suggestion which is the best way to implement.

Aucun commentaire:

Enregistrer un commentaire