Square เพิ่มประสิทธิภาพการทำงานด้วย Compose
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Square ช่วยให้ผู้ขายหลายล้านรายดำเนินธุรกิจ
ตั้งแต่การประมวลผลบัตรเครดิตที่ปลอดภัยไปจนถึงโซลูชัน ณ จุดขาย
และการตั้งค่าร้านค้าออนไลน์ฟรี Square ได้เปลี่ยนไปใช้ UI แบบประกาศมาระยะหนึ่งแล้ว แต่แทนที่จะสร้างเฟรมเวิร์กของตนเองต่อไป Square ตัดสินใจเปลี่ยนไปใช้ Jetpack Compose เพื่อหลีกเลี่ยงค่าใช้จ่ายในการบำรุงรักษาและใช้ประโยชน์จากการปรับปรุงที่ Jetpack Compose มีให้เหนือกว่าระบบ Android Views
สิ่งที่พวกเขาทำ
ทีม Square เริ่มสร้างระบบการออกแบบใน Compose โดยมีเป้าหมาย
เพื่อช่วยให้ทีมระบบการออกแบบและวิศวกรผลิตภัณฑ์ทำงานได้เร็วขึ้น
เนื่องจากแอปของบริษัทจัดระเบียบด้วยสถาปัตยกรรมโฟลว์ข้อมูลแบบทิศทางเดียวอยู่แล้ว "วิศวกรผลิตภัณฑ์จึงสลับไปใช้ Compose ทีละหน้าจอได้อย่างง่ายดาย" ขณะที่ใช้ Compose บริษัทพบว่า "บางครั้งก็ง่ายจนคิดว่าน่าจะซับซ้อนกว่านี้ ทุกอย่างก็ใช้งานได้เลย"
ผลลัพธ์
"การใช้ Compose ช่วยให้เรามุ่งเน้นสิ่งที่ Square มีเอกลักษณ์และโครงสร้างพื้นฐานของ UI
แทนที่จะแก้ปัญหาในวงกว้างเกี่ยวกับการสร้างเฟรมเวิร์ก UI แบบประกาศ"
ทีมวิศวกรพบว่า Compose ช่วยเพิ่มประสิทธิภาพในการทำงาน ทำให้
โค้ดเข้าใจ จัดระเบียบ และเขียนได้ง่ายขึ้น และเครื่องมือของ Android Studio
ช่วยประหยัดเวลาได้มาก
"การจัดรูปแบบคอมโพเนนต์ทำได้ง่ายและรวดเร็วยิ่งขึ้น การอ่านโค้ดสำหรับคอมโพเนนต์ที่ซับซ้อน
ก็ง่ายขึ้นด้วย Compose ช่วยให้จัดระเบียบโค้ดและทำให้อ่านได้ง่ายขึ้น ระบบเลย์เอาต์ของ Compose มีแนวคิดที่เรียบง่ายกว่า จึงง่ายต่อการให้เหตุผล การแสดงตัวอย่างช่วยประหยัดเวลาได้อย่างมากเมื่อสร้าง
คอมโพเนนต์"
เริ่มต้นใช้งาน
ดูข้อมูลเพิ่มเติมเกี่ยวกับฟีเจอร์เขียน
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2021-07-28 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2021-07-28 UTC"],[],[],null,["# Square sees increase productivity with Compose\n\n[Square](https://squareup.com/) helps millions of sellers run their\nbusiness -- from secure credit card processing to point of sale solutions to\nsetting up a free online store. Square has been moving to declarative UI for\na while but rather than continuing to build their own framework, they decided to move to\nJetpack Compose, avoiding the maintenance costs and taking advantage of the\nimprovements it brings over the Android Views system.\n\nWhat they did\n-------------\n\nThe Square team started building their design system in Compose, with the goal\nof enabling their design system team and product engineers to move faster.\nBecause their app is already organised with a unidirectional data flow\narchitecture, *\"It's really easy for product engineers to swap in Compose one\nscreen at a time.\"* While adopting Compose, they've seen that *\"sometimes it's\nalmost so simple you expect it to be more complicated. **Things just work.**\"*\n\nResults\n-------\n\n*\"By using Compose, we can **focus on things that are unique to Square** and our UI\ninfrastructure, rather than solving the broader issue of building a\ndeclarative UI framework.\"*\n\nThe engineering team found that Compose improved their productivity, making the\ncode easier to reason about, organise, and write, and the Android Studio\ntooling saved them a lot of time.\n\n*\"It's **simpler and faster to style components** . Reading the code for complicated\ncomponents is easier as well. It's **easier to organize code and make it\nreadable** in Compose. The layout system of Compose is conceptually simpler so\nit's **easier to reason about. Previews are a big time saver** when building\ncomponents.\"*\n\nGet started\n-----------\n\nLearn more about [Compose](/jetpack/compose)."]]