avatarFred Grott

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

5713

Abstract

" allowfullscreen="" frameborder="0" height="undefined" width="undefined"> </div> </div> </figure></iframe></div></div></figure> <figure id="5993"> <div> <div>

            <iframe class="gist-iframe" src="/gist/fredgrott/fc7b48783ce77c67af54b3243006bdc3.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure>
    <figure id="4104">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/fredgrott/22bac1fd359383360fd67260c0746d71.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="88c4">Then we have an event bus interface:</p>
    <figure id="c6bb">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/fredgrott/e30d57d03dff54d94f88856477cdf518.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="428d">Now we need a subscription event handler:</p>
    <figure id="c8de">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/fredgrott/c52aa337fe25541713523cfac388a98a.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="3db9">And the event bus itself:</p>
    <figure id="3482">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/fredgrott/d1175201168d20d68638b4cd5187d7c8.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="197d">The modifications I made to Andrew’s code was to make it always log using my app logger.</p><h1 id="2fa9">Resources</h1><p id="d98e">Resources because no one has the money to go into debt for the private college CS, the private art college degrees, and the psychology degrees that are required to make the human emotional transformative software that this new human emotional world requires.</p><p id="01c7">Chris Do’s Futur YouTube channels</p><div id="9e0d" class="link-block">
      <a href="https://www.youtube.com/@thefutur">
        <div>
          <div>
            <h2>The Futur</h2>
            <div><h3>Our mission is to teach 1 billion people how to make a living doing what they love. #1BminusOne Private art school…</h3></div>
            <div><p>www.youtube.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*JomnG9TvzBUVvTqM)"></div>
          </div>
        </div>
      </a>
    </div><div id="4acb" class="link-block">
      <a href="https://www.youtube.com/@TheFuturAcademy">
        <div>
          <div>
            <h2>The Futur Academy</h2>
            <div><h3>Welcome to The Futur Academy, the sister channel of The Futur. While our main channel is focused on mindset, money, and…</h3></div>
            <div><p>www.youtube.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*quJlsw6vWyhP-w9o)"></div>
          </div>
        </div>
      </a>
    </div><p id="eb8e">Resources at AIAG</p><div id="fa73" class="link-block">
      <a href="https://www.aiga.org/resources">
        <div>
          <div>
            <h2>Resources</h2>
            <div><h3>We are committed to advancing the future of design within our communities, among our members, in small businesses and…</h3></div>
            <div><p>www.aiga.org</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*hsD5c8dFvbQ_7mdZ)"></div>
          </div>
        </div>
      </a>
    </div><p id="fd13">Nielsen Norman Group Articles</p><div id="8a3b" class="link-block">
      <a href="https://www.nngroup.com/articles/">
        <div>
          <div>
            <h2>UX &amp; Usability Articles from Nielsen Norman Group</h2>
            <div><h3>Research-based articles about user experience (UX), interaction design, web usability, user testing, and UI/GUI design…</h3></div>
            <div><p>www.nngroup.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*6zIV4o5SoAPoj2qJ)"></div>
          </div>
        </div>
      </a>
    </div><p id="aec5">Flutter Internals Book</p><div id="0010" class="link-block">
      <a href="https://flutter.megathink.com/">
        <div>
          <div>
            <h2>Introduction</h2>
            <div><h3>community-maintained open source book providing a guided tour through Flutter's implementation.</h3></div>
            <div><p>flutter.megathink.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*wRl1PoykzIxyVtV3)"></div>
          </div>
        </div>
      </a>
    </div><p id="fd4d">Dart VM Internals</p><div id="b855" c

Options

lass="link-block"> <a href="https://mrale.ph/dartvm/"> <div> <div> <h2>Dart VM</h2> <div><h3>Warning This document is work in progress. Please contact Vyacheslav Egorov ( by mail or @mraleph) if you have any…</h3></div> <div><p>mrale.ph</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*-KjF3XRZyi0HA6NR)"></div> </div> </div> </a> </div><p id="b98f">Awesome Psychology List of Resources at GitHub provided by WeeBox</p><div id="640a" class="link-block"> <a href="https://github.com/weeeBox/awesome-psychology"> <div> <div> <h2>GitHub - weeeBox/awesome-psychology: An awesome list of psychology courses, videos and books…</h2> <div><h3>A categorized community-driven collection of high-quality awesome Psychology courses, videos, and books. Suggestions…</h3></div> <div><p>github.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*c3tmjWMg91D9xWOm)"></div> </div> </div> </a> </div><h1 id="56e1">Thoughts</h1><p id="7ac7">I have no idea why the Google Flutter GDEs are not covering Feature Domain Driven Design app architecture other than they have no freaking idea of what Command Query Responsibility Segregation and Event Sourcing’s role in implementing Feature Domain Driven Design in the first place. The other reason why this is important is that Feature Domain Driven Design with CQRS and ES at its core is the way to in fact implement both SOA and Microservices in a Dart or Flutter application.</p><p id="685d">Now, onwards to the CQRS part of CQRS-ES core of Feature DDD app architecture.</p><h1 id="ce88">About Fred(Fredrick) Grott</h1><p id="9525">Look the quality of Flutter GDE’s somewhat sucks, for example this Flutter GDE is recommending <b>avoiding singletons in this article:</b></p><div id="4554" class="link-block"> <a href="https://codewithandrea.com/articles/flutter-singletons/"> <div> <div> <h2>Singletons in Flutter: How to Avoid Them and What to do Instead</h2> <div><h3>Singletons are a very controversial and debated topic in the software development community: Some people say you should…</h3></div> <div><p>codewithandrea.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*lwjFcejjxRtU17tz)"></div> </div> </div> </a> </div><p id="3058">And the same Flutter GDE turns around in the same article and recommends a singleton solution to state management which is opposite of what Google recommends! I also find numerous UX design mistakes as well with the same Flutter GDE people. You as a Dart and Flutter App designer and developer deserve better in the <b>quality of Google Dart and Flutter design and developer coverage.</b></p><p id="8b78">I found after I got control of my ADHD that my ADHD super-powers of focus, seeing connections before others, emotionally wanting my audience to win, and my strong visual organizational and design bias in fact makes me the perfect one to teach both design and software development of Dart and Flutter applications. Your hero arch in Dart and Flutter app design is not won on logic but the actual practice of story-telling until I find the exact right combination of logic, visual, story, etc. to reach all of you about Dart and Flutter app design. Just as this winning you as an audience is emphatically a process, so too is the design of Dart and Flutter Apps, and I am here to win the war of reaching all of you to impart the art of the process of Dart and Flutter App design.</p><p id="2181">By joining medium (yes, I get a cut of that membership fee which I use to update equipment), you can unlock past the first 3 free articles and get my full stream of my articles AND exclusive to Medium members a free preview of my Flutter Design Book chapters which I am publishing on Medium as an exclusive Medium membership benefit. If, however, you currently do not have the money to invest in a Medium membership I do post the medium free article links on <b>these social media platforms:</b></p><p id="73ea">YouTube <a href="https://www.youtube.com/c/FredGrott">https://www.youtube.com/c/FredGrott</a></p><p id="d1c9"><b>LinkedIn <a href="https://www.linkedin.com/in/fredgrottstartupfluttermobileappdesigner/">https://www.linkedin.com/in/fredgrottstartupfluttermobileappdesigner/</a></b></p><p id="916c"><b>Instagram <a href="https://www.instagram.com/fredgrott/">https://www.instagram.com/fredgrott/</a></b></p><p id="8b7c"><b>Twitter <a href="https://twitter.com/fredgrott">https://twitter.com/fredgrott</a></b></p><p id="b194">As I travel on this adventure of starting my own brand story telling studio, I will be publishing some UIKits and books at GumRoad:</p><p id="0409"><a href="https://fredgrott.gumroad.com">https://fredgrott.gumroad.com</a></p><p id="e045">And of course I will publish free UIKits on:</p><p id="77ea">GitHub <a href="https://github.com/fredgrott">https://github.com/fredgrott</a></p><p id="4234"><b>Dribbble <a href="https://dribbble.com/FredGrott">https://dribbble.com/FredGrott</a></b></p><p id="10cb"><b>BeHance <a href="https://www.behance.net/gwsfredgrott">https://www.behance.net/gwsfredgrott</a></b></p></article></body>

The Core Of Google’s Recommended Flutter Feature DDD App Arch, Event Sourcing

No Flutter GDE seems to understand that to implement Google’s DDD Feature Flutter App Architecture hinted in the Flutter Skeleton App template one has to implement the CQRS-ES set of patterns. CQRS is command query responsibility segregation and the ES part is event sourcing.

This article will cover the event sourcing part, which of course implies reactive events using reactive programming.

The Reactive Programming Core, The App Observable Logger

It is ill-formed myths about antipatterns that can kill the UX responsiveness of our Flutter app, in this case it’s both singletons and event buses. In the case of singleton’s while the use cases of singletons are not as wide when it got introduced as an OOP pattern during C++ heyday; it still can be used for those use cases where it’s an OOP item that we never test in the first place such as app loggers.

In the event bus use cases, it was not the event bus itself that was the actual antipattern, but the fact that they were implemented in non-reactive programming ways that presented bottlenecks in the communication between application components.

And both things implemented in the right avoiding antipatterns way that form the Event Sourcing backbone of both the Command Query Responsibility Segregation (CQRS, which simply means that we separate the crud operations of read and write to be separate, and it’s a command query pattern that acts as input and output to the crud read and write operations) pattern and the full Domain Driven Design Feature architecture that is often nicknamed the vertical slice DDD app architecture pattern due to the fact that the decoupled communication between application layers forms a vertical slice and Google calls it Feature as we can split our areas of application concerns by feature named folders of screens as the communication to the domain is decoupled via the CQRS-ES.

While I do not show this in this example, the observability of the app logger comes from the decoupled appenders we can implement using the logger appenders package as it has four pre-made appenders and infrastructure to manually implement our own appenders to integrate with any 3rd party logging observability service providers we want to integrate with.

So let’s get down to implementing a perfect application logger that has at its core a singleton:

It’s the factory singleton pattern that uses a private constructor, a reference to the private constructor and a factory to implement the singleton, with the initialization being in the factory block. And in the factory initialization block I am setting up the levels that the logger listens to and an actual listener for log events that handles both logging errors and stacktraces and normal log events.

Now we need the other part of event sourcing, the actual event bus that at it’s core uses reacting programming just like this application logger as the internals of the logger class uses streams as evidenced by the way I have declared the listener.

The Event Bus

I modified Andrew’s Event Bus Plus code to integrate with CQRS and that original code is under MIT license copyright of 2021 and the package is here:

Let’s talk about OOP patterns for a moment. We want to pass around events that happened to get logged by the application logger. And at some point integrate those event objects with a command query pattern. That implies that the underlying event objects are in fact value-objects that need to be comparable to each other based on value and not type as a group of events will still have the same run-type, such as app event for example.

So I am going to use the non-code-generation solution of using the package Equatable to create some value objects for the event bus:

Then we have an event bus interface:

Now we need a subscription event handler:

And the event bus itself:

The modifications I made to Andrew’s code was to make it always log using my app logger.

Resources

Resources because no one has the money to go into debt for the private college CS, the private art college degrees, and the psychology degrees that are required to make the human emotional transformative software that this new human emotional world requires.

Chris Do’s Futur YouTube channels

Resources at AIAG

Nielsen Norman Group Articles

Flutter Internals Book

Dart VM Internals

Awesome Psychology List of Resources at GitHub provided by WeeBox

Thoughts

I have no idea why the Google Flutter GDEs are not covering Feature Domain Driven Design app architecture other than they have no freaking idea of what Command Query Responsibility Segregation and Event Sourcing’s role in implementing Feature Domain Driven Design in the first place. The other reason why this is important is that Feature Domain Driven Design with CQRS and ES at its core is the way to in fact implement both SOA and Microservices in a Dart or Flutter application.

Now, onwards to the CQRS part of CQRS-ES core of Feature DDD app architecture.

About Fred(Fredrick) Grott

Look the quality of Flutter GDE’s somewhat sucks, for example this Flutter GDE is recommending avoiding singletons in this article:

And the same Flutter GDE turns around in the same article and recommends a singleton solution to state management which is opposite of what Google recommends! I also find numerous UX design mistakes as well with the same Flutter GDE people. You as a Dart and Flutter App designer and developer deserve better in the quality of Google Dart and Flutter design and developer coverage.

I found after I got control of my ADHD that my ADHD super-powers of focus, seeing connections before others, emotionally wanting my audience to win, and my strong visual organizational and design bias in fact makes me the perfect one to teach both design and software development of Dart and Flutter applications. Your hero arch in Dart and Flutter app design is not won on logic but the actual practice of story-telling until I find the exact right combination of logic, visual, story, etc. to reach all of you about Dart and Flutter app design. Just as this winning you as an audience is emphatically a process, so too is the design of Dart and Flutter Apps, and I am here to win the war of reaching all of you to impart the art of the process of Dart and Flutter App design.

By joining medium (yes, I get a cut of that membership fee which I use to update equipment), you can unlock past the first 3 free articles and get my full stream of my articles AND exclusive to Medium members a free preview of my Flutter Design Book chapters which I am publishing on Medium as an exclusive Medium membership benefit. If, however, you currently do not have the money to invest in a Medium membership I do post the medium free article links on these social media platforms:

YouTube https://www.youtube.com/c/FredGrott

LinkedIn https://www.linkedin.com/in/fredgrottstartupfluttermobileappdesigner/

Instagram https://www.instagram.com/fredgrott/

Twitter https://twitter.com/fredgrott

As I travel on this adventure of starting my own brand story telling studio, I will be publishing some UIKits and books at GumRoad:

https://fredgrott.gumroad.com

And of course I will publish free UIKits on:

GitHub https://github.com/fredgrott

Dribbble https://dribbble.com/FredGrott

BeHance https://www.behance.net/gwsfredgrott

Flutter
Software Development
Software Engineering
Flutter App Development
Recommended from ReadMedium