lundi 16 juillet 2018

design pattern which allow different return type

I have a class which have certain functionality and return type is "A" (just an assumption) I need to create few class which will just use the data "A", making some customization and return it in different format. (Say, classB return "Type B" and class C return "Type C". Both the Type B and Type C is using same data "A" but with few customization and few added data.

I analyzed builder, adapter, strategy and factory pattern. But all are returning either void or same data type or interface. I want my return type to be different.

Please guide me which design pattern i can use in this case.

Regards, Saurabh

Aucun commentaire:

Enregistrer un commentaire