Clean iOS Architecture pt.1: Analytics Architecture Overview

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ธ.ค. 2024

ความคิดเห็น • 108

  • @cest102
    @cest102 5 ปีที่แล้ว +56

    This is EXACTLY what I've been looking for. There are so many tutorials on how to build app x or y, but none go into architecture like this (most of them don't even discuss architecture at all). You're learning how to build that specific app only in those tutorials. THIS teaches the thinking in how to design/ build any app. Really excited to finish this series. Thanks!

    • @EssentialDeveloper
      @EssentialDeveloper  5 ปีที่แล้ว +1

      We're glad to know you're learning from and enjoying the videos! Welcome to our channel and community. 🤝⛩

  • @ramonharomarques5165
    @ramonharomarques5165 5 ปีที่แล้ว +9

    30 minutes that blew my mind! Great to have tutorials with this sort of level of thinking!

    • @EssentialDeveloper
      @EssentialDeveloper  5 ปีที่แล้ว

      Hey Ramon, thanks for the feedback and welcome to the channel! ✅

  • @nightMARE24X7
    @nightMARE24X7 3 ปีที่แล้ว +5

    I wish i had known about this channel and the essentialdeveloper site earlier, like 3-4 years back. Would have been a different story. Anyhow, better late than never and thanks for such quality stuff. It actually changes the way you approach a problem and think, visualize it before even firing up Xcode to write a single line of code.

  • @donk8961
    @donk8961 5 หลายเดือนก่อน

    This is quality. I love listening to programming advice while working out but so many iOS videos are just “make x app.” I’m beyond that, I can make any of those apps independently, but not quite a full senior yet. This is exactly the gap I need to fill, thanks for the upload.
    If I’d watched this 3 years ago I could have petitioned to rewrite our app’s analytics layer because hooo boy any time a new view controller was added I had to modify 4 other files just to do analytics without compile errors.

  • @hibob841
    @hibob841 3 หลายเดือนก่อน +1

    I wish I'd discovered your content years ago. I've studied all kinds of books, tutorials, videos from many authors, and learned a lot from them. However, I feel many of them fall short in using overly simplified, trivialized examples that simply don't translate or scale to the kinds of _real-world_ apps that we get paid to develop. Conversely, any time I watch some of your content, I feel like I can turn around and immediately start improving things in my _actual_ projects. Thank you.

  • @benjamighty
    @benjamighty 9 หลายเดือนก่อน

    I really like how you progressively improve the architecture and I learn more that way! Awesome tutorial

  • @abhishekbedi1432
    @abhishekbedi1432 7 ปีที่แล้ว +9

    This is a great video especially the manner in which it is delivered. Going through each of the possible approaches to the software design, highlighting where code breaks the SOLID principles and henceforth put forward the possible alternate approaches with merits & demerits. Superb Guys! Please keep up this approach of delivering content. A big 👍

  • @AbidHussain-pu3nm
    @AbidHussain-pu3nm 5 ปีที่แล้ว +6

    This is probably one of the best tutorial on iOS Architecture. Thumbs up for the good work.

  • @stevenwarren5727
    @stevenwarren5727 ปีที่แล้ว

    As a professional iOS dev, I can say this is a really, really excellent video

  • @outrowender
    @outrowender 2 ปีที่แล้ว +1

    Caio, what a great course! I'm lovin it!
    BTW are you brazilian? Your accent is looks like from brazil haha

    • @EssentialDeveloper
      @EssentialDeveloper  2 ปีที่แล้ว +1

      Thank you, Wender! Yes, I'm Brazilian 🙂🇧🇷

  • @nazmul__islam
    @nazmul__islam 4 ปีที่แล้ว

    The best tutorial on iOS architecture I've seen till now. Thumbs up. 👍

  • @CaptainPrice5-fs9fp
    @CaptainPrice5-fs9fp 4 หลายเดือนก่อน

    Very interesting topic. At 23:40, can you please explain, how do you implement the name and metadata in the LoginEventEnum or MessageListEventStruct?
    Thank you

    • @EssentialDeveloper
      @EssentialDeveloper  3 หลายเดือนก่อน

      Thanks! They can be associated values in enums and properties in structs, for example.

  • @karthikkmanoj8662
    @karthikkmanoj8662 4 ปีที่แล้ว

    Trust me! People need to learn these things before learning to program! You created a new way of thinking when we design software.
    Thank you so much!

  • @almahdc
    @almahdc ปีที่แล้ว

    I just saw this video. Great approach and a great topic. Really easy to follow. I loved that you started with an non-optimal architecture and evolved it. I already feel smarter. Thank you!

  • @caiocorrea88
    @caiocorrea88 7 ปีที่แล้ว +3

    Really good video! Thanks for making this comparison between all the approaches.

  • @陳涵宇-d4s
    @陳涵宇-d4s 4 ปีที่แล้ว +1

    I watch again, and it's still beautiful.

    • @陳涵宇-d4s
      @陳涵宇-d4s 4 ปีที่แล้ว +1

      Just try to write a sample code in this repo. hope helpful.
      github.com/rollr76518/AnalyticsEnginePractice

  • @hussienfahmy7533
    @hussienfahmy7533 ปีที่แล้ว

    You are a legend man!

  • @javiersiancas2726
    @javiersiancas2726 4 ปีที่แล้ว +1

    Hi! I'm currently building an analytics architecture based on this video, but I'm also struggling with those predefined parameters and events names Firebase Analytics suggests me to use. What are the best recommendations to use them without letting my independent modules know anything about Firebase? Hope you can help me with that. Thanks!

    • @EssentialDeveloper
      @EssentialDeveloper  4 ปีที่แล้ว +1

      Hi Javier, you can use adapters/wrappers to handle communication with the frameworks. So, you decouple your app from the 3rd-party code. Watch parts 2 and 3 to learn more. ✅

  • @ariyaman90
    @ariyaman90 3 ปีที่แล้ว

    I can't press the like button more than 1 time! But you think I pressed it 100 times :)))))

  • @startover305
    @startover305 3 ปีที่แล้ว

    Good video! Just reminds me what I experienced with one of my projects. I used enum for types of pollutants. But later changed to use POP to handle the increasing amount of types of pollutants.

  • @jeremyli8325
    @jeremyli8325 ปีที่แล้ว

    good content for a new beginner

  • @patchinator7883
    @patchinator7883 5 ปีที่แล้ว +1

    Outstanding video! Super useful, thanks very much!
    Help needed:
    The only part that was difficult to understand for me was the removal of the AnalyticsManager class at the end. Wouldn't moving the log function into the protocol force you to have many redundant implementations of log in your view controller classes? Can someone shed some light on that part for me?

    • @patchinator7883
      @patchinator7883 5 ปีที่แล้ว

      Or would those implementations go in the Analytics Engines at the top?

    • @EssentialDeveloper
      @EssentialDeveloper  5 ปีที่แล้ว +1

      Thanks! That's it. The implementations are in the top layer. The view controllers would just send `log` messages through the protocol abstraction. ✅⛩

    • @karlalalalalala
      @karlalalalalala 5 ปีที่แล้ว

      Hi @@EssentialDeveloper, same here. Still don't get the final implementation.
      From the first approach, the `class` engines (conforming to `AnalyticsEngine`) all have the `log()` method triggered by the dependency injection `AnalyticsManager`'s `log()` method that would eventually be invoked from the view controllers.
      How is the last approach different?
      How would the arrows from view controllers pointing to `AnalyticsEngine` protocol be implemented? Should the view controllers have a property `AnalyticsEngine` so each would be able to call the `log()` method and send each viewcontroller-specific event as param?
      Would really appreciate your response. Thank you! :)

    • @EssentialDeveloper
      @EssentialDeveloper  5 ปีที่แล้ว +1

      Hi Karla, that's right, view controllers can have a property `` and call `log()` passing ViewController-specific events. The implementations of the `` are unchanged (e.g., CloudKit and Firebase implementations).
      The role of the `AnalyticsManager` class presented in the first solution was basically to extract the `AnalyticEventEnum` "name" and "metadata" properties to send to the `` protocol abstraction.
      The difference displayed in the last solution is: by breaking down the "Analytics Events" into separate types and extracting/grouping the Analytics abstractions (protocols) in the same "module/layer," we don't need an `AnalyticsManager` anymore.
      From the architecture point of view, such a manager class is not required and add no benefits to the design. As you said, we can inject implementations of the `` protocol in the ViewControllers and call the `log` method directly in the protocol reference instead of injecting and calling the method on an `AnalyticsManager`.
      Not a significant architectural change, but we removed an unnecessary class while achieving the same goals! Does it make sense now?
      Thanks for the question! ⛩

    • @karlalalalalala
      @karlalalalalala 5 ปีที่แล้ว

      @@EssentialDeveloper
      Hi! Thank you for the clarification and the detailed explanation. Really appreciate that!
      I'm currently implementing the last approach so thank you so much!

  • @nikprabha9099
    @nikprabha9099 ปีที่แล้ว

    This is a great explanation, but one doubt since AnalyticsEvent is not having event methods other than name and metadata, I am curious to know how ViewController will call specific event. Could you please share some block of code or any thoughts on this?

    • @EssentialDeveloper
      @EssentialDeveloper  ปีที่แล้ว

      Hi! The VC doesn't need to create the specific events directly. The VC could only delegate messages like `purchaseButtonClicked()` - and another component - like an analytics event handler - receives the message and creates the specific events ✅

  • @medhadashraf1867
    @medhadashraf1867 6 ปีที่แล้ว +3

    What tool did you use to draw the class diagrams ?

  • @RohitSharma-lz8db
    @RohitSharma-lz8db 3 ปีที่แล้ว

    Amazing Video... Can you please recommend any good book for design patterns

    • @EssentialDeveloper
      @EssentialDeveloper  3 ปีที่แล้ว +1

      Hi Rohit, thank you! You can find our book suggestions here: www.essentialdeveloper.com/book-suggestions

  • @arkemal
    @arkemal ปีที่แล้ว

    This is excellent! Thank you!

  • @parsoj
    @parsoj 6 ปีที่แล้ว

    I'm going through alot of your videos including this specific series. This is all *really* quality stuff - thanks!
    I would say this content is pretty high-value to me - so I'd be happy to support it.
    Just FYI - If you set up a Patreon - I would contribute to it.

    • @EssentialDeveloper
      @EssentialDeveloper  6 ปีที่แล้ว

      Hi Jeff, thanks for the support! We really appreciate it! ✅⛩

  • @amitmajumdar2205
    @amitmajumdar2205 2 ปีที่แล้ว

    Awesome explanation. What tool do you use to draw the diagrams?

  • @jeffrysandypurnomo5558
    @jeffrysandypurnomo5558 ปีที่แล้ว

    Anyone can help me, what does 11:50 - 12:00 means, I think the `AnalyticsManager` just get the `name` and `metadata` from the `AnalyticsEventEnum`, why we can't make it one module with the `AnalyticsEngine`?
    even everytime we have new event, the `AnalyticsManger` would just call the properties of the `AnalyticsEngine` name and metadata right?
    or Caio means since it's concrete `AnalyticsEventEnum` in `AnalytcisManager`, so that the module can't be use for other cases other that `AnalyticsEventEnum`? coz it has to be `AnalyticsEventEnum`?

    • @jeffrysandypurnomo5558
      @jeffrysandypurnomo5558 ปีที่แล้ว

      Dangg... I just reach 19:40 and it's amazing... what a game changer between enum and struct,
      hmm but what's difference if u have an enum and extension of method that return a value? ah maybe it still depends on the case 11:50 previously ya, it will state param type of the enum and return type is not standarized stated in the enum, so other developers could implement it wrong, okay.. hmm
      since it's struct based, the value of static method will always in form of `AnalyticsEventStruct`, rather than enum which we can't define it well (i mean the struct will always return `AnalyticsEventStruct`, but if enum use the extension just like struct on 19:40, it cant return a exact form like `AnalyticsEventStruct`)

    • @jeffrysandypurnomo5558
      @jeffrysandypurnomo5558 ปีที่แล้ว

      Hmm i have questions, what if i want to log some event to firebase and some event to cloudkit at the same controller? refer to sundell's MessageListViewController class so maybe
      let CKAnalyticsManager = AnalyticsManager(engine: CloudKitAnalyticsEngine())
      let FBAnalyticsManager = AnalyticsManager(engine: FirebaseAnalyticsEngine())
      let messageController = MessageListViewController(message: messageCollection, analytics: CKAnalyticsManager)
      hmm it wont work, since we will only have 1 MessageListViewController inside `AnalyticsManager` only have 1 engine.. hmm.. maybe need to modify the controller so that
      MessageListViewController(message: messageCollection, CKAnalytics: CKAnalyticsManager, FBAnalytics: FBAnalyticsManager)
      hmm but its feel very attached with CKAnalytics param, maybe we need to modify the `AnalyticsManager` coz it supposed to `Manage` right, maybe like...
      class AnalyticsManager {
      private let cloutKitEngine: AnalyticsEngine
      private let firebaseEngine: AnalyticsEngine
      init(cloutKitEngine: AnalyticsEngine, firebaseEngine: AnalyticsEngine) {
      self.cloutKitEngine = cloutKitEngine
      self.firebaseEngine = firebaseEngine
      }
      func logCloudKit(_ event: AnalyticsEvent) {
      cloutKitEngine.sendAnalyticsEvent(named: event.name, metadata: event.metadata)
      }
      func logFirebase(_ event: AnalyticsEvent) {
      firebaseEngine.sendAnalyticsEvent(named: event.name, metadata: event.metadata)
      }
      }
      hmm.. the param seems redundant type of `AnalyticsEngine`, i don't know.. any ideas?

    • @EssentialDeveloper
      @EssentialDeveloper  ปีที่แล้ว

      Hi! With the enum approach shown, adding a new case is a breaking change and requires the recompilation of all dependent modules. But with the struct approach, new events can be added without recompiling other modules ✅
      Regarding the second question about multiple engines, you can use the Composite design pattern. Keep watching this series and you'll see it in practice!

    • @jeffrysandypurnomo5558
      @jeffrysandypurnomo5558 ปีที่แล้ว

      @@EssentialDeveloper Thankyouu guyss, love it

  • @crdave1988
    @crdave1988 4 ปีที่แล้ว

    Fantastic Work!
    One small doubt. If we remove AnalyticsManager then who will provide the body of log() method and hold actual Object of Engine?

    • @EssentialDeveloper
      @EssentialDeveloper  4 ปีที่แล้ว

      Hi Chintan, thank you! You'll find the answer in parts two and three:
      Part 2: th-cam.com/video/C2GyNTN4j4o/w-d-xo.html
      Part 3: th-cam.com/video/GzFD7R_CI04/w-d-xo.html

  • @rosspatman8398
    @rosspatman8398 5 ปีที่แล้ว

    Thanks for the video Caio. Could you outline your approach if you wanted to share events between view controllers/modules?

    • @EssentialDeveloper
      @EssentialDeveloper  5 ปีที่แล้ว

      Hi Ross! We believe you will find the answers you're looking for in the next parts of this series, where we go deeper into this topic. Let us know! ✅

    • @rosspatman8398
      @rosspatman8398 5 ปีที่แล้ว

      @@EssentialDeveloper Thanks, will do!

  • @milanbojic2854
    @milanbojic2854 3 ปีที่แล้ว

    Great stuff, thank you so much for sharing this precious knowledge!

  • @rain_maiden
    @rain_maiden 3 ปีที่แล้ว

    How would you write the one-liner for the ViewController in the structs approach? I tried to implement it following the diagram and I can't figure out how to do it.

  • @TewariVarun
    @TewariVarun 7 ปีที่แล้ว +1

    Great video ! what tool are you using in this video for diagraming ?

  • @陳涵宇-d4s
    @陳涵宇-d4s 5 ปีที่แล้ว +2

    Architecture is important!!!

  • @МахмуджанНиязов
    @МахмуджанНиязов 3 ปีที่แล้ว

    Hello!!! Please tell a newbie which playlist to start with?

    • @EssentialDeveloper
      @EssentialDeveloper  3 ปีที่แล้ว +1

      Hello! Our content is not intended for total beginners - it's for iOS developers with professional experience. If you're familiar with the basics, you can follow this playlist: th-cam.com/play/PLyjgjmI1UzlSUlaQD0RvLwwW-LSlJn-F6.html

  • @dilshodzopirov6568
    @dilshodzopirov6568 10 หลายเดือนก่อน

    Best explanation

  • @DimaJP
    @DimaJP 4 ปีที่แล้ว

    Really, really ,really nice - thanks a lot for this video.

  • @gulyaboiko
    @gulyaboiko 5 ปีที่แล้ว

    Hello and thank you for the lesson, I am in 11 minutes and don't understand why we have to change AnalytisManager when we add some new event to the Enum? Where we have to change code?
    class AnalyticsManager {
    private let engine: AnalyticsEngine
    init(engine: AnalyticsEngine) {
    self.engine = engine
    }
    func log(_ event: AnalyticsEvent) {
    engine.sendAnalyticsEvent(named: event.name, metadata: event.metadata)
    }
    }
    And second question: if i need to use two engine at the same time should I keep AnalyticManager and have array of AnalyticEngine in

    • @EssentialDeveloper
      @EssentialDeveloper  5 ปีที่แล้ว +1

      Hello Gulya,
      1) You don't need to change the AnalyticsManager. Just the AnalyticsEvent enum extension.
      2) You can find the solution for this scenario in pt.3 ✅

  • @tityseptiani8584
    @tityseptiani8584 7 ปีที่แล้ว +2

    Do you have any premium tutorials on udemy or your website? You should create more tutorials! I will definitely buy them. I'm waiting for more from you. Cheers :)

    • @HashemRC
      @HashemRC 4 ปีที่แล้ว

      essentialDeveloper.com

  • @sreehari4219
    @sreehari4219 5 ปีที่แล้ว +1

    Which app you used to draw diagrams?

  • @CodeByNSR
    @CodeByNSR ปีที่แล้ว

    What app used to draw it?

  • @PS-dp8yg
    @PS-dp8yg 6 ปีที่แล้ว

    Any course for beginners? Or any recommendation where to start? I looked on your website, and it is a little confusing where to start...at least for me. I'm open to buy an of your courses as long it starts from the beginning for beginners.

    • @EssentialDeveloper
      @EssentialDeveloper  6 ปีที่แล้ว

      Hi! It depends on your level. If you're a beginner but familiar with the basics of programming already, we recommend to you our course "Swift Feed App Case Study" - academy.essentialdeveloper.com . We're covering advanced topics but with an approachable methodology. It's been popular among beginners as well. We believe you'll greatly benefit from it as others have so far. ✅⛩

    • @PS-dp8yg
      @PS-dp8yg 6 ปีที่แล้ว

      @@EssentialDeveloper Thank you for the response and sorry for the late reply. I don't have any ios or any unit testing experiences, but I do know the swift language and OOP concepts. Is the course you provided still valid for my case?

    • @EssentialDeveloper
      @EssentialDeveloper  6 ปีที่แล้ว

      Yes, absolutely! Swift and OOP is more than enough. See you there. 🤝⛩

    • @PS-dp8yg
      @PS-dp8yg 6 ปีที่แล้ว

      @@EssentialDeveloper Thanks, just bought your course.

  • @mirellys
    @mirellys 4 ปีที่แล้ว

    Great video, thanks for your time :)

  • @abdulyasin_iOS
    @abdulyasin_iOS 8 หลายเดือนก่อน

    Oh my God. You explained it in a much much better way. Thank you sooo much Captain 🫡

  • @RNHJZ
    @RNHJZ 5 ปีที่แล้ว

    actually namespacing is not a problem. Nobody restricts you to keep your modules modular with their own namespaces. At least in Swift.

    • @EssentialDeveloper
      @EssentialDeveloper  5 ปีที่แล้ว +1

      Exactly, it's a problem when they're in the same module! That's another benefit of separating your code into modules in Swift. ✅

  • @Alimirrrr1
    @Alimirrrr1 6 ปีที่แล้ว

    Great job!

  • @carlosandressanchez4196
    @carlosandressanchez4196 5 ปีที่แล้ว

    what's the name the software?

  • @kalashchoudhary4713
    @kalashchoudhary4713 ปีที่แล้ว

    This video will help in 2023?

  •  2 ปีที่แล้ว

    凄い

  • @heitornovais7010
    @heitornovais7010 3 ปีที่แล้ว

    Brazuka aqui! rsrs

  • @iosdev7452
    @iosdev7452 6 ปีที่แล้ว

    cool

  • @ericcartman5166
    @ericcartman5166 5 ปีที่แล้ว +2

    "Great." :D