巴士总站中的预订对象或销售对象或两者 [英] reservation object or sale object or both in bus terminal ??

查看:98
本文介绍了巴士总站中的预订对象或销售对象或两者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



请指导我有关总线终端中由该对象组成的座椅对象属性:
巴士对象-座位对象-旅行对象-票证对象-乘客对象-销售对象-预订对象等

Hi,

Please guide me about seat object attributes in bus terminal that terminal consists of this objects:
bus object - seat object - travel object - ticket object - passenger object - sale object - reservation object and so

public class bus
{
public bus()
{
}
//attributes
private string name;
private string id;
private int capacity;
private seat _seat;
}

public class seat
{
public seat()
{
}
//Attributes
private int seat_id;
private bool seat_status;
private bool seat_place;// it means that seat places besides the window or not
}


我想知道:
座位对象由乘客对象组成吗?
还有一个问题:


I want to know:
Is seat object consist of passenger object?
and another question:
Is it necessary to have all ticket and sale and reservation objects or any one is necessary?

推荐答案

座位对象是否由乘客对象组成?"
否,但是它可能需要一个Passenger对象或[可能更好] Reservation 对象.如果您具有其中之一,则可能不需要seat_status.

需要机票,买卖和预订"
答案取决于系统实际需要执行的操作.例如,如果您可以无保留地购买机票,那么您可能会同时需要这两个条件,但是如果系统始终分配保留,那么它可能会处于启用状态门票. 销售"有点棘手,因为它可能意味着很多事情,但是假设它像发票"(即帐单信息),听起来确实很明智.
"is the seat object consist of the passenger object???"
No, but it might need a Passenger object or [probably better] Reservation Object. seat_status probably isn''t needed if you have one of these.

"Are necessary ticket and sale and reservation"
The answer depends upon what the system actually needs to do.For example, if you can buy a ticket without a reservation, you''ll probably need both of these, but if the system always allocates a reservation, it might as well be on the ticket. "sale" is a bit more tricky as it could mean one of many things, but assuming it is like an "invoice" i.e. billing information, it does sound sensible.


我认为您想要要知道

系统和系统中应该有多少个对象?
它们之间是什么关系

基本上可以看到,这取决于项目规模/项目级别

例如您的问题是
Is seat object consist of passenger object?

如果您的系统需要存储乘客ID和乘客信息
然后是

但是如果您想存储座位是否被占用,则可以使用简单的bool类型对其进行管理.

Is it necessary to have all ticket and sale and reservation objects or any one is necessary?

再一次,如果您想存储分配给谁的票证/预订信息,则应该拥有所有类型的对象


我注意到的另一件事
在您的 Bus 类中, seat 对象应该是座椅的集合.
I think you want to know

How many objects should be in system and
What are the relationship among them

see basically it is depends on project size/project level

for example your question is
Is seat object consist of passenger object?

if your system need to store passenger id and information of passenger
then yes

but if you want to store that the seat is occupied or not than you can manage it with simple bool type.

Is it necessary to have all ticket and sale and reservation objects or any one is necessary?

again if you want to store information which ticket/reservation is allocated to whom than you should have object of all that types


one more thing I have notice
In your Bus class seat object should collection of seat.


所有类结构都取决于您要解决的实际问题向下.在这种情况下,您需要自己弄清楚预订是给乘客的,还是预订确实是机票的一部分.
All class structures are dependant upon the actual problem you are trying to break down. In this case you need to figure out for yourself whether the the reservation is given to a passenger, or is the reservation really part of a ticket.


这篇关于巴士总站中的预订对象或销售对象或两者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆