0

I have to create entity with many parameters, about 100-150 fields. Basically, it's entity which store information about estates. I know that one object with so many parameters will be bad so now I'm thinking about three solutions:

  1. Create estate entity with common ~20 fields and another one like estates_parameters with rest of it (~100 fields).
  2. Create estate entity with common ~20 fields and four other entities with parameters for specific type of estates like estate_house_parameters, estate_flat_parameters and so on. Each of them would have about 30 fields.
  3. Create estate entity with relationship ManyToMany with different entity which store information about type of parameter, it's value and related estate.

What is important, that I have to search for estates by this parameters.

Which solution will be the best or maybe there are other, better solutions?

Maciej Mortek
  • 96
  • 1
  • 4
  • 2
    creating big entity is not always bad. solution 1 does not bring any advantage but only making things complicated - bad solution. solution 2 is not very good in case you need to add another type of entity or in case you have the same fields in more types - bad solution. i would go with solution 3 (but create 2 entities, one would specify "field" (name, type, default value, options, ...) and the other one "field_value" would hold value for property and field – Miro May 13 '16 at 20:50
  • Possible duplicate of [What are design patterns to support custom fields in an application?](http://stackoverflow.com/questions/1126783/what-are-design-patterns-to-support-custom-fields-in-an-application) – luchaninov May 14 '16 at 13:42

0 Answers0