简体   繁体   English

广告系统的类图

[英]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. 我尤其不确定Column class因为在我看来它可以只是可变的。

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), 您需要记住,每个广告系统都有不同的报告结构:不同的命名列,不同的列顺序,不同的日期格式此外,广告系统中的数据还具有不同的数据格式(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) 每个系统的报告包含不同数量的列,我们的应用程序仅对其中一些感兴趣:日期,ad_campaing,ad_group,关键字,印象数,价格(在每个系统中,它们具有不同的名称)

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). 如果您希望多个广告系统以一种通用格式(例如CSV)传送数据,而只有列名不同,那么您可以创建一个通用的CSV_ReportLoader,它从配置文件(或配置对象)读取列名映射。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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