Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 649 Bytes

File metadata and controls

24 lines (18 loc) · 649 Bytes

ReflectionFactory

It's a simple example which shows how to use reflection with factory pattern

The example uses reports generation as a subject area

Input params:

  • int value of report type which be generated
  • useful data for report

How it works

  • mark derived classes of base report via custom attribute with report type
  • use reflection to find nesssary report class by custom attribute
  • use reflection to create instance

P.S. This small example can be a good test task

Because used:

  • basic OOP's principles
  • factory pattern
  • reflection
  • attributes
  • secure coding

Also you can expand and complement it for your purposes