vendredi 12 février 2021

Design pattern for an tool with common and changed fields

I am thinking for design pattern for automated testing one of tool. It is changing based on some type chosen saving some common fields for all types.

For example: Type 'A' chosen:

  • Unique_field_for_A_01
  • Unique_field_for_A_02
  • Unique_field_for_A_03
  • Common_field_01
  • Common_field_02
  • Common_field_03

Type 'B' chosen:

  • Unique_field_for_B_01
  • Unique_field_for_B_02
  • Common_field_01
  • Common_field_02
  • Common_field_03

Type 'C' chosen:

  • Unique_field_for_C_01
  • Unique_field_for_C_02
  • Unique_field_for_A_01
  • Unique_field_for_B_01
  • Common_field_01
  • Common_field_02
  • Common_field_03

The problem:

  1. there are 10-40 unique fields for some types, with 30 fields always common
  2. some types have intersected fields with other types (like 'Unique_field_for_A_01', 'Unique_field_for_B_01' for Type C);

I was thinking on using 'Builder' + 'Composite' but not sure if maintaining 70 fields too complex with creating multiple instances even if I group some common/unique fields in some groups?

Aucun commentaire:

Enregistrer un commentaire