Waris Limtoprasert

Waris Limtoprasert

Data Engineer at Big Data Institute (Public Organization), BDI

บทความทั้งหมด

All Articles

Author Category Post Filter
มาใช้ diagram อธิบายการทำงานของระบบต่าง ๆ กันเถอะ
หากเราจะอธิบายการทำงานของระบบบางอย่างให้คนอื่นเข้าใจได้ง่าย ๆ คงหนีไม่พ้นการทำ diagram ที่สามารถแสดงให้เห็นถึงกระบวนการของระบบ ขั้นตอนการทำงาน หรือเห็นแต่ละกลุ่มที่มีหน้าที่ในระบบนั้น ๆ diagram ที่เราจะนำมาพูดถึงในวันนี้คือ sequence diagram และ activity diagram ทั้งสองเป็น diagram ที่มีวัตถุประสงค์ในการแสดงพฤติกรรมการทำงานของระบบ สามารถเห็นภาพรวมของระบบหรือกระบวนการของงานได้ง่ายขึ้น ตัวอย่างระบบการทำงานที่สามารถใช้ diagram เช่น การทำงาน/การคำนวณค่าบางอย่าง หรือ ระบบที่มีการเรียกใช้งานระบบส่วนอื่น ๆ เพื่อทำงานอะไรบางอย่าง sequence diagram และ activity diagram ทั้งสองอย่างนี้เป็นส่วนหนึ่งของ Unified Modeling Language (UML) คือเป็นภาษาภาพที่มีมาตรฐานกลางที่ใช้ในการอธิบายระบบ เพื่อให้เกิดความเข้าใจแก่ผู้ออกแบบกับโปรแกรมเมอร์ หรือฝั่งที่เกี่ยวกับ business ส่วนใหญ่จะถูกใช้ในบริบทเกี่ยวกับการพัฒนาซอฟต์แวร์ แต่ก็สามารถใช้อธิบายระบบต่าง ๆ เพื่อให้คนทำงานทั่วไปเข้าใจได้เช่นกัน Activity diagram เป็น diagram ที่แสดงถึง workflow กิจกรรมของระบบ แสดงขั้นตอนการทำงานหนึ่งไปสู่อีกอันหนึ่ง โดยวิธีการเขียนจะต้องมีจุดเริ่มต้น-จุดสิ้นสุด และมีกิจกรรมต่าง ๆ ที่เกิดขึ้นระหว่างจุดเริ่มต้นกับจุดสิ้นสุด สัญลักษณ์พื้นฐาน สัญลักษณ์ ชื่อ คำอธิบาย Initial State / Start Point จุดเริ่มต้น Activity or Action State กิจกรรม Object FlowGuards การไหลของกิจกรรม Guards กรณีมีเงื่อนไข Synchronization กรณีมีการทำกิจกรรมพร้อม ๆ กัน Final State / End Point จุดสิ้นสุด ตัวอย่าง Activity diagram ทั้งนี้ activity diagram สามารถแบ่งหมวดหมู่ของกิจกรรมได้ด้วยการเขียนเป็นแบบ Swimlanes ที่จะจัดกิจกรรมแต่ละอันตามหมวดหมู่ หรือผู้ที่รับผิดชอบกิจกรรมนั้น เพื่อให้เห็นภาพของระบบได้ง่ายขึ้น เช่น การบริการลูกค้าของร้านอาหาร จะแบ่งเป็น 3 ส่วน ได้แก่ ลูกค้า พนักงาน พ่อครัว ตัวอย่าง activity diagram แบบ Swimlanes Sequence diagram Sequence diagram ใช้แสดงถึงการปฏิสัมพันธ์กันในแต่ละส่วน ว่ามีการส่งข้อความหรือข้อมูลอะไรถึงกัน โดยแสดงตามลำดับของเวลา สัญลักษณ์พื้นฐาน สัญลักษณ์ ชื่อ คำอธิบาย Actor ผู้กระทำต่อระบบ Object อ็อบเจกต์ที่ต้องทำกิจกรรม Lifeline เส้นการมีอยู่ของอ็อบเจกต์ Focus of Control / Activation แสดงถึงจุดเริ่มต้นและจุดสิ้นสุดของช่วงการทำกิจกรรม Message คำสั่ง หรือฟังก์ชันการทำงานที่มีการส่งไป Callback / Self Delegation คำสั่ง หรือฟังก์ชันการทำงานที่เรียกภายในตัวเอง ตัวอย่าง sequence diagram โดยทั้ง 2 diagram นี้สามารถทำออนไลน์ผ่านเว็บบราวเซอร์ได้เลย ตัวอย่างที่มีให้ใช้งานได้ฟรี เช่น diagrams.net, visual-paradigm online ที่สามารถทำได้ทั้ง activity diagram และ sequence diagram และผู้เขียนขอแนะนำเว็บไซต์ทำ sequence diagram แบบ codebase (ทำ diagram ด้วยการเขียนเป็นโค้ด) ทำให้ไม่ต้องเสียเวลาจัดรูปแบบ ปรับขนาดกล่อง ข้อความต่าง ๆ แค่พิมพ์ให้ถูกลำดับ ถูกไวยากรณ์ของเว็บไซต์ที่เราใช้งาน เช่น SequenceDiagram.org, WebSequenceDiagrams การเลือกใช้งานระหว่าง 2 diagram นี้จะขึ้นอยู่กับว่าเราต้องการโฟกัสที่จุดไหน หากต้องการเห็น workflow ของกิจกรรมที่เกิดขึ้นภายในระบบก็ให้เลือก activity diagram แต่หากต้องการโฟกัสที่ลำดับขั้นการทำงานของระบบ โดยเน้นที่ข้อความหรือคำสั่งที่มีการแลกเปลี่ยนระหว่างอ็อบเจกต์ก็ให้เลือก sequence diagram เนื้อหาโดย วริศ หลิ่มโตประเสริฐตรวจทานและปรับปรุงโดย อิสระพงศ์ เอกสินชล
12 July 2022
12 เทรนด์เทคโนโลยีเชิงกลยุทธ์ ในปี 2022
เช็คเทรนด์เทคโนโลยีเชิงกลยุทธ์ที่จะมาแรงในปี 2022 ที่จะเข้ามามีบทบาทในภาคธุรกิจ และส่งผลต่ออนาคตในอีก 3-5 ปีข้างหน้า
24 December 2021
เริ่มต้นสร้าง API ง่าย ๆ ด้วย FastAPI Framework
มาเริ่มทำ API ด้วย FastAPI framework ที่ทั้งเร็วและเข้าใจง่าย สามารถเขียนด้วยภาษา python และมี API document ที่สามารถใช้ทดสอบ API ของเราได้ทันทีเลย
30 September 2021
เคล็ด(ไม่)ลับการใช้ Postman
มารู้จัก Postman ให้มากขึ้นกัน ด้วยเคล็ด(ไม่)ลับที่จะทำให้คุณรู้จักฟังก์ชันอื่น ๆ ที่มีประโยชน์อย่างมาก และจะทำให้คุณใช้งานได้อย่างมีประสิทธิภาพมากขึ้น
29 March 2021
PDPA Icon

We use cookies to optimize your browsing experience and improve our website’s performance. Learn more at our Privacy Policy and adjust your cookie settings at Settings

Privacy Preferences

You can choose your cookie settings by turning on/off each type of cookie as needed, except for necessary cookies.

Accept all
Manage Consent Preferences
  • Strictly Necessary Cookies
    Always Active

    This type of cookie is essential for providing services on the website of the Personal Data Protection Committee Office, allowing you to access various parts of the site. It also helps remember information you have previously provided through the website. Disabling this type of cookie will result in your inability to use key services of the Personal Data Protection Committee Office that require cookies to function.
    Cookies Details

  • Performance Cookies

    This type of cookie helps the Big Data Institute (Public Organization) understand user interactions with its website services, including which pages or areas of the site are most popular, as well as analyze other related data. The Big Data Institute (Public Organization) also uses this information to improve website performance and gain a better understanding of user behavior. Although the data collected by these cookies is non-identifiable and used solely for statistical analysis, disabling them will prevent the Big Data Institute (Public Organization) from knowing the number of website visitors and from evaluating the quality of its services.

  • Functional Cookies

    This type of cookie enables the Big Data Institute (Public Organization)’s website to remember the choices you have made and deliver enhanced features and content tailored to your usage. For example, it can remember your username or changes you have made to font sizes or other customizable settings on the page. Disabling these cookies may result in the website not functioning properly.

  • Targeting Cookies

    "This type of cookie helps the Big Data Institute (Public Organization) understand user interactions with its website services, including which pages or areas of the site are most popular, as well as analyze other related data. The Big Data Institute (Public Organization) also uses this information to improve website performance and gain a better understanding of user behavior. Although the data collected by these cookies is non-identifiable and used solely for statistical analysis, disabling them will prevent the Big Data Institute (Public Organization) from knowing the number of website visitors and from evaluating the quality of its services.

Save settings
This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.