oop - How should I model a single entity that has data from multiple data sources? -



oop - How should I model a single entity that has data from multiple data sources? -

multiple info sources used provide same info cars. users able view , compare auto info each source.

for 2 types of cars, 3 info sources used provide info cars. 3 info sources same.

for other types of car, 2 info sources used. 1 info source vary among 15 different info sources depending on type of car. other info source remain fixed (and 1 of 3 noted in above paragraph).

for given type of car, info source may have info (e.g. price) auto not nowadays in other info sources. in cases, 1 info source may have auto not exist in other (two or three) info sources.

each auto need mapped same auto among different info sources. scheme determine mapping. in cases, admin need @ auto info , determine same auto beingness referred in different info sources.

how should model in relational database , oop? should each source-car become table/class (e.g. kellybluebookcar)? or should model have single table/class, car, datasource column/field?

your database has minimum of 3 tables, , should have many more:

the first auto type, have relations many more--including brand, model, year, , maybe trim, alternative package, etc.

the sec phone call source, may want assign more specific name, such car_data_provider or something.

the 3rd contains actual data, , has foreign keys first two, plus actual info you're interested in (price, etc.).

looking @ oop classes, depends on many factors relating general architecture , utilize cases. if you're familiar domain driven design, auto type suggests aggregate root. @ rate, create auto type enriched object contains source data.

oop database-design relational-database data-modeling

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -