Asynchronous programming best practices

后端 未结 4 1255
遇见更好的自我
遇见更好的自我 2020-12-12 11:15

I have recently written my first Android app which was roughly 8,000-10,000 lines of code. One thing that continuously hindered my use of normal design patterns was android

4条回答
  •  醉梦人生
    2020-12-12 11:44

    If handling the the UI is your biggest concern, then you'll want to master event-driven coding. The ideas behind event-driven coding are behind all modern UI systems, and are useful in all kinds of things (not just UI).

    The easiest way for me to think of it when learning was simply to treat each component and event as if it's self-contained. All you need to worry about is the event object passed into your event method. If you're used to writing applications that run basically from beginning to end, it's a bit of a mind shift, but practice will get you there pretty quickly.

提交回复
热议问题