Choosing the right design pattern/architecture for a scenario

I have a situation, in which I would like your opinion about the best approach that I should take.

Let’s consider 10 classes (obj001, obj002 etc.) all which represent some business entities, and are to be serialized with XML and sent via a WS to another server. Each of these classes is backed-up by a XSD schema (from which they were built). There are certain differences in their structure, so they cannot be treated all the same (eg. one may contain a table with values, another one only few static fields).

Now, I have to develop a desktop application (.net based, so either Winforms or WPF), with a distinct screen for each entity, and the following functionalities: Save to XML, Load from XML, Submit msg (send over WS), Generate document (filling a template), Validate object etc.

Methods like Generate document and Validation must be implemented differently due to the nature of the objects.

Currently I have a tabbed page control, and each page contains the data fields for a certain object. All the function buttons are common, docked to top, and based on the active page, they perform the corresponding action.
The event flow works like this:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>buttonSave_Clicked
switch (selected_page)
if obj001_page then
SerializeOBJ001();
if obj002_page then
SerializeOBJ002();
else ...
end
end
</code>
<code>buttonSave_Clicked switch (selected_page) if obj001_page then SerializeOBJ001(); if obj002_page then SerializeOBJ002(); else ... end end </code>
buttonSave_Clicked
  switch (selected_page)
     if obj001_page then
       SerializeOBJ001();
     if obj002_page then
       SerializeOBJ002();
     else ...
  end
end

I thought of the following approaches too:

  1. Create buttons on each tab page (this means I would know exactly what logic to execute. But still, they are all together.
  2. Convert the application to WPF, and build custom controls for each object, that are totally in charge of the corresponding logic and UI – a lot of redundant code!

As an example, my obj001 class, has over 20 properties (attributes), and all are binded to textboxes in the UI, so all the validations are written and performed in the MainWindow.cs class. Moving them to a separate class would mean to pass each value as a parameter to the validator, which is quite inpractical too. Maybe switching to MVVM (and making use of the WPF’s data binding) is a better solution, don’t you think?

Extensibility is very poor: for each new object, I have to add a new case to each function button. And the MainWindow.cs class is getting heavier and heavier.

I’m new to software engineering. Starting from scratch, what would be the right approach? What architectural or design pattern(s) should I look into? And how should I structure my classes?

Thank you!

6

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