对象的模型位置时间线

发布于 2024-11-08 02:24:54 字数 197 浏览 0 评论 0原文

我正在寻找对象的时间线模型。例如,包含飞机和机场的数据库模型将具有一个类/表,其中包含到达机场和从这些机场起飞的飞机。我可以接受飞机在机场的简单场景,当进行更改时就会出现逻辑问题。假设飞机 1 不在机场 1,而是在机场 2 和机场 3,这就是模型变得棘手的地方。

我知道我不是第一个在建模对象时间线时遇到问题的人,并且想知道是否有人可以向我指出一些资源或提供建议。

I am looking to model the timeline of an object. For example, a database model with airplanes and airports will have a class/table consisting airplanes arrival at airports and and the departure from these airports. I am okay with the simple scenario of an airplane at an airport, the logic problems arise when changes are made. Let's say that Airplane 1 wasn't at Airport 1 but was at Airport 2 and 3, this is where the model gets sticky.

I know that I am not the first person to have issues modeling a timeline of an object and was wondering if anyone could point me to some resources or give advice.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆离笙 2024-11-15 02:24:54

不确定您正在描述哪种逻辑问题,或者您的目标是什么用例,但这里有一个听起来适合您的示例的模式:

Airport
-------
AirportID INT
Airport VARCHAR

Airplane
--------
AirplaneID INT
Airplane VARCHAR

Arrival
--------
ArrivalID INT
AirplaneID INT
ArrivalTime SMALLDATETIME

Departure
---------
DepartureID INT
AirplaneID INT
DepartureTime SMALLDATETIME

或者您可以代替单独的到达和出发表/类有一个活动课

EventTypes --Would have things like "Arrival", "Departure", "Delay", etc
----------
EventTypeID INT
EventType VARCHAR

Event
-----
EventID INT
EventTypeID INT
EventTime SMALLDATETIME

Not sure exactly what kind of logic problems you're describing, or what use case you're aiming for, but here's a schema that sounds like it'd fit your example:

Airport
-------
AirportID INT
Airport VARCHAR

Airplane
--------
AirplaneID INT
Airplane VARCHAR

Arrival
--------
ArrivalID INT
AirplaneID INT
ArrivalTime SMALLDATETIME

Departure
---------
DepartureID INT
AirplaneID INT
DepartureTime SMALLDATETIME

OR instead of separate arrival and departure tables/classes, you could have an events class

EventTypes --Would have things like "Arrival", "Departure", "Delay", etc
----------
EventTypeID INT
EventType VARCHAR

Event
-----
EventID INT
EventTypeID INT
EventTime SMALLDATETIME
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文