Is actor a own class

I have this sequence diagram and want to transform it into a class diagram.
But I don’t know if the actor (Customer) is in this case a own class or not. Normally the actor isn’t a own class, but in this diagram there are methods performed on the customer…

Sequence diagram

1

I don’t think so. You recognize intuitively you need a Customer class because you need to track a Customer, not just things a Customer does. You have CustomerAccount, so perhaps that is where vagueness sets in. I think this is your “Customer class.”

I think your Customer is indeed the actor. Since you have CustomerAccount, you have a Customer object (which is what I was mentioning above.) For the purpose of this Sequence Diagram, I do not see how it shows you need a Customer class beyond CustomerAccount. An audit trail or log? Maybe. I don’t know.

2

I think Customer is a misnomer here. Actually it’s a CustomerSession.

As we see, the leftmost actor gradually acquires various access tokens and other API responses, and uses them to proceed to next steps.

If I were designing it, I’d use a chain of immutable steps that represent each step of the session, and would only allow to make the next correct steps. This way, the correct workflow was statically verifiable.

class CustomerSessionInitialStep {
   CustomerSessionReservationStep makeReservation(ReservationSystem) {...}
}

class CustomerSessionAccountStep {
   CustomerSessionLocationStep enterLocation(ReservationSystem, Location) {...}
   CustomerSessionInitialStep cancelReservation(ReservationSystem) {...} 
}

// etc

What I associate with a Customer is identity, contact information, etc. It should not change in the course of making an order.

In some design methodologies, the Actor at the left-most part of a sequence diagram is actually an abstraction of a GUI layer. The Actor name (Customer) is likely taken from a Use Case, so we can trace to the requirement and understand the context. The actor icon also helps understand.

For example, in a Java Swing implementation of the GUI, the makeAReservation() message would be sent from within an actionPerformed() method for a button in a dialog. If the application was web-based, it’s maybe a REST call or a post from a page or javascript. You could even have voice recognition (like Siri) send the makeAReservation() once it recognizes the proper series of voice commands.

But adding all these details to the diagram make it more complex. We all know that GUIs change a lot, so keep it abstract. Think of it as the blue part in the diagram below:

enter image description here

Leaving it as an Actor class gives you flexibility to design the presentation layer (aka GUI), and you can support more than one style of presentation.

So, the short answer is no, Customer is not a class in the context of this diagram. That is not to say, however, you won’t have a Customer class (as a domain class).

Lets consider Customer a class,

Class Customer
{
  public makeAReservation();
  pubic SelectVehicle();
  pubic ConfirmReservation();
}

I would take Customer as a Class but not in this sequence diagram context, by seeing the above sequence diagram the methods mentioned above will break the SRP if we would consider Customer as class.

i agree with 9000’s answer

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật