简体   繁体   中英

Class diagram for ad system

So I created an class diagram according to the assignment, is this the right way to do it ? I am especially not sure about the Column class because it seems to me that it can be just variable.

You are building application that will load data from several different advertising systems and then store the data into database, so it will be possible to analyze them.

You need to take in mind that every advertising system has different structure of report: Different named columns, different order of columns, different date formats Also data from ad systems are in different data formats(JSON,CSV,XML),

Reports from each system contains different amount of columns, our application is interested only in some of them: date, ad_campaing, ad_group, keyword, impressions, price (in every system they have different name)

Logic of advertising accounts is that one ad campaing contains multiple ad groups and one ad group contains multiple keywords.

在此处输入图片说明

I assume you need to make a class diagram to model the source code to be written using an object oriented language. I think the best approach is to create an adapter class for each specific type of report (ie for each distinct advertising system). Each adapter class implements a generic interface (or abstract base class) in order to load its particular report type. Here is my diagram. I have drawn three adapters, but there could be more or less.

在此处输入图片说明

If you expect that multiple ad systems deliver data in a common format, eg CSV, while only the column names differ, then you could create a generic CSV_ReportLoader which reads the column name mapping from a configuration file (or configuration object).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM