Jon (00:05.252) Welcome back to another Gone Mobile. Alan, I thought we'd continue on the topics, the really fun, exciting topics today. What do you think? Do you have any? Allan Ritchie (00:14.555) This was all your notes too. And it's funny, he went to dependency injection. This was supposed to be an episode where John was supposed to babble now, but I guess he's left this one to me because this is. Jon (00:22.148) Well, you just said that it was my turn to figure out what the topic was. You didn't really say it had to be something I was going to talk about. Allan Ritchie (00:26.554) Yeah. Well, it's true. It's just we have our strengths. So this I'm guessing this is one of mine. It's my. OK. Jon (00:35.396) Yeah, it's definitely not mine. you know, we, I've, I've, relented, enough to say, yeah, I'm using dependency injection and it's a good thing. And I'm glad we got it in, in Maui along with all the other stuff, but I still, I'm still a little bit, unlearned on some of the, the dependency injection stuff. just, you know, some of the, Allan Ritchie (00:56.377) I do have a screenshot of you saying you bought in. I kept it. I kept it for, you know, just in case. I'm still waiting for our RX to appear. Once you say RX, I'll take the screenshot of that too. We'll see. Jon (01:01.06) Yeah, yeah. Well, I mean, yeah, it could have gone either way, I guess, right? I could have bought in and been like, no. No. I need to make like a library that I call Rx or something like that. And just so you're like, you did it finally. Like, no, it's something totally different. Got you. Yeah. Allan Ritchie (01:15.929) All right, so we're talking about DI. DI dependency injection. So. Jon (01:23.844) Yeah, this isn't a .NET specific concept, right? By any means. I've seen it pop up in many places. Allan Ritchie (01:32.056) I think it actually started more in the Java world to be honest. No, it's I don't know. Castle Windsor, like the library, not the castle itself. That one is when I was working with Enhybernate like 20 some odd years ago, I contributed to that open source quite some years ago. Jon (01:39.492) Hmm. Yeah, not the castle. Jon (01:51.3) Oof. Jon (01:55.204) I don't know what's kind of more shock value if it's that and hibernate is that old or that you know, you remember working with something that long ago. I mean, I do too, but just like when you say it that way, it's like, yeah, it was 20 years ago. Ooh. Allan Ritchie (02:04.567) Hehehe Allan Ritchie (02:09.111) Well, it was in high because I worked with hibernate like when I started out of school, I was in Java. And I got into hibernate really quick because I like the code. I like sequel less even though that changes from time to time. Yes. One on steroids. Jon (02:21.412) That, yeah, it was a, Hibernate was an ORM, right? Yeah, okay. So what did that have to do with dependency injection? Allan Ritchie (02:29.846) Because it was so interwired with, do you remember lazy loading? Did you ever use Hibernate? You must have used Anhybernate. So they had this concept of like lazy loading proxies, right? So if I went like, I had an order and then let's say I had to order items, but I only said, okay, get me the order. And then what I do is I'd go through it and then I go, okay, now dot order items and right away the proxy would go, hey, I'll load that up. You haven't loaded it up already. Jon (02:36.356) I think I used to un -hybernate at some point. Jon (02:46.756) Mm -hmm. Jon (02:57.604) Right. Allan Ritchie (02:58.901) So that was Castle Windsor and Castle Windsor back then was like a huge, now Windsor was the DI library. They still have Castle Dynamic Proxy. That might be one that people have heard of. That's the inhibernate thing. So it's a really cool way of like at runtime building IL around your code. So it was like, it was like Stone Age kind of source generators, but run at the runtime, right? So. Jon (03:11.46) Okay. Jon (03:24.324) Yeah, yeah. That run, yeah. Allan Ritchie (03:27.06) It took forever to start. Like, man, it's like we didn't care about startup time back then. And I know that's kind of hypocritical coming out of me because it's like enterprise libraries. I'm like, who cares? Like John and I always go through this debate. He's like, I want an app nice and trimmed and it's got to start up with like 300 milliseconds faster. And I'm like, there's no enterprise customer that gives, you know, where's the beep button about that? And there isn't, right? Really. Jon (03:34.532) Yeah. What the? Yeah, buttery smooth. Jon (03:51.78) But my customers aren't enterprise, so. Allan Ritchie (03:54.611) Well, the ones I see using Mao here are usually pretty darn big. Jon (03:58.628) No, no, no, I don't mean Maui itself. I mean, I mean my pool app, of course. Yeah. Allan Ritchie (04:02.195) okay. Okay. Yeah. You got to shave that that hundred milliseconds that nobody knows about, but that's fine. That's a everybody's got their. Jon (04:06.084) That's right. People want to be swimming, not putting data into their pool app. Allan Ritchie (04:11.738) So they had dynamic proxy. We had Castle Windsor, which was like the I don't know that there was a dependency injection library before that. I don't. It was a different era back then. We didn't have open source. We had like we had open source, but it was was the old open source hub we used to use. Jon (04:23.268) Hmm. Jon (04:30.788) well there was a Microsoft one. There was, no, I know. Yeah. No, there, what? It's going to bug me now. Yeah. Codeplex. That was theirs. What was, I still see the other one if we're thinking of the same one every once in a while, like it's still there as a website. It's not, is it source forge? Is that. Allan Ritchie (04:33.682) nobody used that. That was even before that. Cause that codeplex, Microsoft's codeplex and they killed that pretty quick. Allan Ritchie (04:47.025) It's... Yeah, it's like some old decrepit thing. that might be it. Yeah, that's where N -hibernate was. OK. Jon (04:56.708) I don't know. Or is that a... I don't know. Maybe it is. Maybe it was. Allan Ritchie (05:01.329) It was a lot harder to find this stuff back then, because we didn't have Nuget, we didn't have Crepes, we didn't have half the tools we did. Maybe we were better off, I don't know. Soon we get things done. Anyhow, so Castle Windsor was like the first DI container I knew of. It was slow. Things have evolved quite a bit since then. I'd say the most feature rich one out there is probably AutoFac. I know. Dan Siegel of Prism fame would argue his dry IOC. He lives and dies by that. And that's made by a fellow out of Ukraine, I believe. Anyhow. Jon (05:38.852) Okay. Yeah, I know. I know there's a bunch of them. Well, and let's back up a step too, because like what, well, did those, those probably initially at least started as their own kind of totally separate libraries, right? Is that, is that true? Cause when I think of those now and maybe, maybe you can still use them that way. I'm sure you can. But what I think of now is, you know, when I look at those, I think of them more as the things that I could opt to plug into kind of the Microsoft extensions stuff. Allan Ritchie (05:51.856) Yep. Yep. Allan Ritchie (06:07.215) Yes. So we're. Jon (06:08.324) instead of like using them super directly, I guess. Allan Ritchie (06:11.407) Well, we're definitely going to come back to that because the Microsoft extensions where we are today. So Microsoft did have their own dependency injection. So they had it was unity part of it at some point and then they gave that one away and then they had another one that was kind of like attribute based, which a lot of companies ended up using. I forget the name of it right now getting old. But it worked. They worked. They were just really slow. They were big dinosaurs. Auto fact is still out there. Jon (06:15.716) Mm -hmm. Jon (06:23.684) I don't know. Jon (06:38.564) Mm -hmm. Allan Ritchie (06:40.144) It's a big dinosaur. It has all these features, but Microsoft released the extensions dependency injection. And I think they did. I think they I'll say they because it's a different team. So yeah. So I think they decided to build that because there was too too many options in the world, right? So you just get a central focus like this is how you do it in ESP net. If you still want to use your original dependency injection container. Jon (06:52.9) Well yeah, I had nothing to do with it. Jon (07:00.452) Right. Allan Ritchie (07:09.296) Here's how you can integrate with it, but here's the standard interface, which wasn't a bad idea because it kind of did unify us under a banner, which was great. So now we had dependency injection under a banner. Jon (07:16.1) Yeah. Well, it's one of those things that's such a big part of a lot of projects that you kind of want to have some out of the box opinionated way to do it, right? Allan Ritchie (07:25.62) Right, right. So it was, it was a good thing because everybody was using dependency injection, but nobody was really doing it properly. And everybody under the sun. I mean, I've been working with Xamarin since like, I don't know, since the Zimian days, like Novell and you know, everybody started doing dependency injection back then and it took forever. I've seen an app where they used AutoFac and it took like 30 seconds for the Android app to start. Jon (07:33.028) Mm -hmm. Jon (07:41.54) Yeah. Yeah. Allan Ritchie (07:54.415) Somehow iOS got through it, but... Jon (07:54.572) Well, iOS was always faster, right? For several reasons, but... Allan Ritchie (08:00.336) Right, so they just had over engineered it 30 seconds to start. Jon (08:04.228) Wow. Well, and this, this is where I think there was, because like historically there, there, as you I think alluded to just by saying like, Hey, I'm finally doing dependency injection. There's was historically a lot of pushback and resistance against using that in the Xamarin space from like Xamarin. I'm not saying that I'm not saying that like the enterprise developers were, had a problem with it. It was like us kind of saying, why would you do that? That makes your app so slow. Allan Ritchie (08:21.902) Yeah, Xamarin. Allan Ritchie (08:30.126) I used to go baddy about that. You think, well, I would nag at you sometimes, but a little bit less. It was usually James and obviously Miguel is as anti dependency injection as you one can be, but dude doesn't build enterprise apps. He doesn't deal with like these massive teams doing these massive things. Right. So maybe you might have less bugs or unit tests. I don't know. Jon (08:46.18) Yeah. And, and, and, and now, you know, like, like I said, I, I've, I'm using it in my app. I'm more, we have it in Maui. I know like James has come on board with it, you know, and the last, I don't know, however long. Allan Ritchie (09:02.031) So James's argument when I talk to him, hi James, sometimes I want to backhand him though. He was like, you know, I don't, it's not that I don't like dependency injection, bullshit. Cause you didn't, and that's all right. You didn't have to, you got your job done, right? But he's like, it had to be out of the box, which that's believable, right? He wants a standard way of doing it. Like we all do. You want to know it's pretty safe to use and it's tested and it's fast. Now, Jon (09:22.66) Yeah. Allan Ritchie (09:30.605) When we talk about the Microsoft extensions, the default container you get out of the box is actually pretty damn fast. Like they did a good solid job on it. So that's why I started using it pretty pretty exclusively in my apps. Other than when you get into Prism and dry IOC, dry IOC, but we won't get into that today. Doesn't matter. The point is, is that that thing is super fast. It gets a job done. It does all of more or less all of the features that you need. Jon (09:42.948) Yeah. Allan Ritchie (10:00.876) AutoFax got some real deep stuff, but this more meant more for server, right? Like AutoFax is such a big beast of four million flavors of features. And if you need that, it's there, right? Jon (10:12.224) Yeah. So like what I mean, I don't think we want to get too deep into, you know, a lot of the server use cases necessarily. Like I think keeping it mobile oriented, but you know what, I guess it's, I think it's worth kind of talking through what are the differences between some of them? Like why would somebody and yeah, we, I get there's server differences, but like are there, is there consideration in the mobile space for why I might want to use, you know, dry IOC versus Microsoft versus AutoFact, whatever. Allan Ritchie (10:19.82) Right. Allan Ritchie (10:41.548) So, that's a tough one. You had this one loaded. I swear John came loaded today to pound some questions in there. So, I mean, Dan and Prism and stuff, they like dry OC because they want a mutable, not an immutable container, a mutable container, meaning that you can change it. You can add stuff to it. They become available, right? I'm not sure I agree with that. Jon (10:49.668) It's all teed up. Jon (11:01.508) Yeah. Okay. Allan Ritchie (11:10.859) It works for them and the dry IOC is super fast. I just don't like how it waits on dependencies. It does like timers and if a dependency doesn't become available in like X amount of seconds, it throws an error and I just, I don't know, there's something about it. Jon (11:26.02) Yeah, that feels odd. Like, when's it gonna, if it's not available now, when's it gonna come available? I don't know. Allan Ritchie (11:30.666) Right. Like if it's in your registration process, like as soon as I start resolving stuff and how I validate it, it just, it there's, I don't know. That dude has made it work and it works well. I don't know how, but the science behind it is pretty magical. I have always been a fan of the immutable containers. So the ones that have like a builder pattern, right? So AutoFac has a builder pattern. The Microsoft extensions has like the service collection, and then you say build service provider and it puts it all together and validates it. So I'm a fan of that personally, because then you know, what's there is done, it works. It's been validated, you know, great, it should just do its thing. These mutable containers though, like I said, that used to be the way we did it. I don't know in the Castle Windsor, that's the way it did it. Dry IOC does it that way and... Jon (12:22.34) Yeah. And I guess I kind of struggled to find a lot of things. Like there was one scenario that that came into play a while back with that. I was, I was using, but it was only in the context of trying to do like some third party C sharp pot reload extension. Right. So it was like, okay, if you want to like, you know, change something out, you know, maybe you want to just replace the service for depending, depending how you were doing it. Right. So like I ran into that and I went down the rabbit hole of like, what if I put in auto fact and I can, you know, update stuff this way. Cause the, I think it was the TBC reload, project at the time I was, I was playing with this was early early Maui days. Right. And so it was kind of like, okay, you can use this, but it was really a simple thing that was like, here's a type that changed. what do you want? Like you go figure out what you want to do with that information. Right. And so I was like, okay, if it's something, you know, if it's a view model, Allan Ritchie (13:00.329) Okay. Jon (13:18.02) the tech, I have a new version of that type. You know, maybe I want to swap that out in the dependency, in the service collection. And so I went down that rabbit hole and very quickly didn't really like working with any of that. Anyway, not from a, like whatever the, the DI was fine. It was more of the, this felt really cumbersome to try and like leverage C sharp hot reload, in my app and knowing that we were kind of already working on, you know, next, evolution of that just out of the box. I was like, nah, I don't want to do this. And I went back. Allan Ritchie (13:27.368) Hehehehe Allan Ritchie (13:47.912) We know what's funny is if the reason I'm anti mutable containers is that if we think about where these containers are probably going, this is a guess. I mean, it's opinionated guess, but I feel pretty strongly in that this is what's going to be coming is the art of registering dependencies. I get it. It's slow. It's kind of a spaghetti factory of stuff. If you're, if you're not really good at what you're doing, Jon (14:14.884) Mm -hmm. Allan Ritchie (14:16.423) But I think where it's really truly going to go, like really we did statics for years, right? We had a default container and it worked. There's still ways we can make that dependency injected, but it still sucks, right? Cause it still requires like a lot of plumbing to go through all of it. Really where I think it's going to go and you're already starting to see this appear and there's, there's some containers out there that are doing this is it's just being source generated, right? So there's no, there's no registration. I mean, there's attributes everywhere, but. it's really, it generates that service provider and under the hood, the generated code is basically going, yeah, new this, new that it can validate it right at compile time. And then when it starts running, I mean, it's going to be blazing fast, right? You can still have scope services. You can still have static singletons. You can still have transients, et cetera, but it's going to be mega fast. And now when that really does happen, there's going to be adjustments by all of us to get there. but I think it's just gonna be attributes or some sort of config file. And you're like, yeah, I need this, this, this, this. Jon (15:19.396) Yeah, that'll be interesting. Because attributes in source gen is always what you want to do, but it's not... I forget if we were at the point where it's assembly level attributes. Again, there were the do that if you can, because it's not the fastest to inspect every type's attributes in a source gen. But maybe it'll work. Allan Ritchie (15:32.133) Hehehe. Allan Ritchie (15:39.845) Well, at some point it, I don't know how you don't get there. Cause really you, if you want to get to that super fast speed, that's going to do it. Like you're back to news, except this time I can change implementations with like one line. Like I can comment this out or I'm not sure. But if I look at dependency injection, it's going to be less about the injection and more about the registration. It's going to be dependency registration. Maybe. Jon (15:47.588) Mm -hmm. Yeah. Jon (16:07.492) Yeah. Yeah. Allan Ritchie (16:08.068) I don't know. There's lots of other things that are in there, right? But that's where I see it going. So that could be what changes of some of this complexity and kind of gets rid of. I don't know. Do we even need containers at that point if it's source gen? I don't know. I don't know. Jon (16:23.748) Maybe not. Yeah, I know even though like when we were looking at implementing, you know, putting in the Microsoft extension stuff and the dependency injection in particular performance was a concern and like early Maui days, you know, we started measuring a lot of it and I think we were surprised at how quick the parts that we thought were going to be slower and it wasn't, you know, it was, it was other things that we didn't really think that much about. They're like, let's not do that. Cause that's actually slow. Allan Ritchie (16:51.876) I think when you guys started out, because I remember having pretty in -depth conversations with you about it was that hosting. And I was like, you got to get that big honking beast out of there. Because it wasn't, they built hosting for like desk, like a console app or. Jon (16:56.452) Yeah. Jon (17:01.732) Yeah. Yeah, I did didn't. The pattern doesn't really apply perfectly to mobile app so. Allan Ritchie (17:09.667) Right. And then you guys started putting it into like your own host. And I think you got rid of configuration. Is configuration still in there? Must be to some. But it's like the just the abstractions. I don't think there's anything really running. Jon (17:14.244) Mm -hmm. Jon (17:19.716) configuration is still there. Yeah, yeah, we don't have anything concrete. Like I know there's been different. Did you do a plugin for some of that? Like there's, there's been a few efforts to like make a configuration provider that can source Jen and you know, because again, at the end of the day, like that was, those were the parts that we realized, these aren't actually the fastest parts. You know, the, because the, the, the plumbing of how that some of those were implemented for like the server side first idea, it just didn't scale well on, on mobile. Like, Allan Ritchie (17:31.042) Yeah. Allan Ritchie (17:48.545) Yeah. Jon (17:52.516) Reading in a JSON file when your app starts up, just not the fastest thing to do. It's not bad, but it's not good. Allan Ritchie (17:57.825) Well, and that's the thing, right? So now we're we're we've got such high speed libraries to like we have system text JSON, which is much faster than Newton soft because it's it's just designed to be fast. It's not designed to be feature rich. So that's out there. Shiny does have like a config where you can read it out of the assets library. Jon (18:07.172) Yeah. Jon (18:13.668) That's better, but it's still, but... Well, yeah, and that's better. But like, I think the default people were going to is like, put it as an embedded resource in your assembly, and then you got to read that back out. And there's all sorts of like little paper cuts doing that way. Allan Ritchie (18:32.896) It's so on track, I guess I'm looking at about 50 milliseconds usually, and that's for fairly decent. Now we're talking about micro size JSON files, right? Like even if it's a couple hundred lines, like it's it's nothing. Jon (18:43.3) Yeah, yeah. It's again, it's not, yeah, it's not bad again, but it's not, it's like, I think the difficulty has always been, you know, we're, we're trying to like, when we look at startup, you know, performance improvements and like, if you'd look at some of what Jonathan peppers has blogged about and done stuff with, it's like, we're looking at any tens of milliseconds are now like, Hey, I can save, you know, 20 milliseconds by doing this in the Maui startup path differently. It's like, yeah, that's a win. Right. So. That's that. Allan Ritchie (19:13.31) What was the other big, the other big one that was logging though. And that was peppers that found that right. Like the console logging, you guys had turned up by default and you're like, Ooh, we better turn that off, right? Because everything was going through it. But once you got those dependencies in order and under control, here we are today. And it, I mean, really in terms of startup, it's a blip. It's a flash in the pan overall. Now, I mean, that's you guys working on optimizations and stuff, but really I don't feel you had to do a ton around dependency injection. Jon (19:17.316) Yeah. Yep. Jon (19:35.652) Yeah. Allan Ritchie (19:42.909) I think it was always the dependencies of that stupid hosting model that doesn't fit what you need anyways. Jon (19:46.948) Yeah. No, exactly. And that was the kind of, you know, realization that we didn't expect was that the parts that were fast, you know, were the parts that we really wanted. So it was all good. Allan Ritchie (19:59.325) Well, the thing is those extensions assume that they have control of the life cycle of the app. Well, I think iOS and Android might have something to say about that. And they don't really let you like a lot of people I see try and do like dependencies and resolve dependencies in the startup and then do async stuff in the app. And it's like, don't do that. Just go to a page, do your async things, then enter the app, right? But stop. And it's always a case of the dependency and how it's used. Jon (20:08.772) Yeah. No. Jon (20:23.332) Yep. Yeah. Allan Ritchie (20:27.709) where stuff starts to hit the fan, because really dependency injection doesn't have to be slow. And I think if we, even if we get to, even if we get to the strongly typed version of it, I think some people still find a way to make it slow. Jon (20:32.1) No, no it shouldn't be. Jon (20:40.26) yeah, definitely. I mean, there's always, there's always going to be somebody who does that. So we've kind of talked, you know, around dependency injection stuff. Actually, one of the things that I was curious too is like, when we're talking about different implementations and stuff, I know after I did things completely properly from a dependency injection perspective, I kind of moved away from wishing I had this, but do some of them still do like, property injection and stuff like is that still a thing as opposed to constructor injection? Because like that's the default right? You create your class and then you define in your constructor all of the different things that you want to magically be injected into that constructor when it's called. Allan Ritchie (21:22.299) I actually don't know. So I've never done property injection and there's reasons for it. I'm not going to say it defeats the purpose of doing dependency injection because that's not true at all. But it does tell you what's absolutely needed. But we can, you know, things like C with C sharp required like a required property now you can, I don't even know if that helps to be perfectly honest, but. Jon (21:32.58) No, but... Jon (21:41.348) Yeah. Jon (21:46.468) Yeah, you kind of set yourself up potentially for being like, Hey, I can just new up this, this type and there's no things and then it just doesn't work at all. Yeah. Allan Ritchie (21:51.322) Right. And all of a sudden all the Lego pieces are missing and it's like, okay, well it couldn't spin itself up and everything's null. It didn't know better. Right. So. Jon (21:59.3) Yep. I think I ran into that when I was like trying to at the tip of everything. I'm like, I still want to new up the first thing and then everything else kind of waterfalls after that, you know, from dependency. Allan Ritchie (22:10.201) We, you had lots of services, right? Yeah. And it's just, you needed the service of services. Jon (22:12.964) Yeah. And so then to like try and new up that first one, which has to pass in everything. Cause yeah, that was a problem. And then I quickly realized, okay, the better way to solve this is just to do the service stuff correctly. And. Allan Ritchie (22:26.97) Well, it takes learning. Like I said, I've seen people like there's an app I'm working with now that's flipping huge. It's huge. And they'll pass through like 20 services and like six of them are required and probably hardly any of them get like a fraction of them get touched, right? On a standard small whatever page they don't get touched. And then. Jon (22:46.788) Yeah. Allan Ritchie (22:53.337) because they need to pass in those services to get it to their base view model, it's like there's like a whole whack going through it. And so it's like they want to give their developers carpal tunnel. That's the joke I usually make. I'm like, if you like typing, this is the way to go, right? Sure. You can copy and paste that. Jon (23:05.472) Yeah. Well, and that, and that's, that's exactly that part of the, you know, my kind of path of realization there. It was like, I've got my base fuel model and now I've got all these things. And then, and that's where, you know, we talked about, and I think even in the last episode about doing, like the services of services, right. Allan Ritchie (23:23.225) Right. But that comes with hassles too, because then you have to get into what the life cycles of those are. Right. So you don't pin them. And the concept of pinning them is, I mean, you know, the life cycles, right? It's a good segue. Yes. So they used to have a whole bunch of them, right? There used to be like a web scoped. There used to be, thread. So you remember when thread static was a thing? I'm not sure if it was quite a, quite a while ago. Jon (23:26.052) Yeah. Jon (23:31.076) Yeah. Jon (23:35.652) Well, this is, this is a good transition maybe. Yeah. Jon (23:49.508) Yeah. Allan Ritchie (23:53.112) So they used to have this concept of all these like different scoping mechanisms. And what it turns out is that that was bloody complicated, right? It was really complicated. The easiest thing was they found to do was if you want scoped, right? What does that scope mean? So in ASP .net, it's the scope of a web request, right? So scoped means I get a request in, start the scope. That's going to include the HTTP context, which includes the URL, all the stuff about the request. Jon (24:01.252) Yeah. Allan Ritchie (24:23.607) can get my cookies and I don't have to worry about colliding with another user data, right? At least in terms of that sense. And instead of trying to figure out how to implement a web scope because, you know, for a while there we had a little, like we had Kestrel, there's IIS, there's, I mean, they all worked on the ASP .NET engine, but there was like subtle differences. And then we even had to have these little one -off web servers kind of taking off. And it was like, what does it mean to that? So when we got this scoped and I don't know who invented it might've been Castle Windsor still, but it was like, okay, you're just going to have like a container of a container. It knows how to register scope and you do you, you start it when you want, you end it when you want. And that's when it goes. So, which that was great. Singleton always been the same thing. It hasn't changed. This was kind of what really made dependency injection good because you didn't have to worry about. Jon (25:00.836) Mm -hmm. Allan Ritchie (25:19.702) You know, if it was Singleton, it just, yeah, that was just so. Well, that's the funny thing. It should never be static underneath the hood, right? In the container itself, but the container would be static. So you just keep getting the same thing. So it was great. But that's always worked the same. And then transient was the same thing. But I saw a lot of people screwing up, right? Because they didn't want it Singleton. They didn't have a scope and transient. It was like, well, to the container, that's one of those ones. I call it the garbage feeder. Right. It's like you want that. OK. Jon (25:20.068) Yeah, there's no static somewhere, right? You just get the instance of it and it's there. Jon (25:30.916) Right. Jon (25:47.652) Yeah. Here's an instance. Yeah. Allan Ritchie (25:49.525) Here's like the assembly factory. It just gives it to you, but it never crushes the can at the end. So if you didn't clean up and if you got stuff that needed to be cleaned up in it, well, you got to crush the can yourself because you asked for it off the assembly line. You got to send it back for recycling yourself. But if you enter the scope, it's like, yeah, I'll just keep a string on each one of those cans. And as I feed it to you, you can keep asking for different things, but I'll keep giving you the same can in that scope. And then when you tell me I'm done, Jon (26:00.996) Mm -hmm. Allan Ritchie (26:19.699) I'll pull those cords and rip all the cans back in and crush them for you. Right? So it was really a good, good use of doing it. It wasn't a bad analogy either. Jon (26:23.652) Yeah. Jon (26:28.74) No, it's not too bad. So what does that look like from a Maui app perspective? Allan Ritchie (26:34.259) Well, so there's a couple of things, right? I've seen, I think when Maui first started and people were kind of entering the world of dependency injection, because it forced it on some new devs, which I think it was the right thing to do. I mean, I was a big advocate when you guys started doing it. I was like, now you're doing it the same as ESP .net and everybody's trying to plug this in themselves and they keep screwing it up. So they still keep screwing it up a lot of people, but that's all right. Jon (26:44.804) Mm -hmm. Jon (26:52.356) Yeah, no, I have zero regrets. Jon (27:00.388) Well. Allan Ritchie (27:01.523) At least there's a way that you should be doing it, right? But because there's still that kind of half story around view models, people started registering their view models as singletons. And that's a problem because... Jon (27:16.484) I mean, unless you very well know why you might want that in some specific case, but I have a hard time thinking of when that would be. Allan Ritchie (27:23.219) I'm not sure if people understand it because you know if you think about a page like a page is you spin it up I enter some stuff and then it tears down it's always been that way I've like you start up a screen right if it was Windows forms we need up a screen we popped it on right if it was if it's a web page spin up the page request the URL here's your page like it's one and done. Jon (27:35.14) Yeah. Jon (27:48.388) Mm -hmm. Allan Ritchie (27:50.867) Sure, memory flows within that scope of things, but I don't wanna come back to that URL and it's like, hey, I still got all your credit card and stuff in here, by the way, right? Jon (27:58.852) Yeah, yeah, all that all those properties that you filled out and you know, we're to a bound or whatever. They're all still here Allan Ritchie (28:03.987) and by the way, it's also shared across the entire website. We made it singleton across the entire website. So now we're showing the last person's credit card that was entered on that page. Here you go. Right. I mean, obviously that's not going to happen for a web page, but you get my point. And obviously, you know, in a mobile app, you know, it's it's my scope. The problem is, is that you now have to write code to clean up. Like I want to turn that text box back to blank. I want to turn the selected. Jon (28:08.676) Yeah. Jon (28:18.308) Yeah. Allan Ritchie (28:33.554) drop down back to the default it's like if you had to just started it new and the view model was new you wouldn't have to deal with that right so obviously the two for that is transient and scoped now in a mobile app personally everything is a singleton or scoped to me services are always singleton again this is my opinion you do what works for you I wouldn't make anything transient because Jon (29:01.22) What about your pages or your view models? Allan Ritchie (29:04.594) Right. And the reason is, is it transient? Like I said, you got to crush your own cans at that point. I don't think it does Maui any helping. Like how do you clean up the page now properly? I mean, you guys are imploding it through the navigation service, but you can't get at the view model. Maybe you could. You guys could do binding context. Is it eye disposable? Do you guys do that? Do you know? I doubt it. Jon (29:21.156) Well, I mean, it depends how you... Jon (29:26.052) I don't know. Yeah. Good question. And well, and that kind of like leads into, you know, some of the questions and even you and I were talking about it and I wasn't sure what our default, you know, where, where our boundaries for scopes were. there is a doc that we have that's just on the, the, you know, Wiki on GitHub that has a little bit of information that Shane put in about scopes. it might not be. Yeah. I had two years ago. Allan Ritchie (29:49.777) And I'm not even sure that's up to date. Because I am pretty sure, and I know Prism, and I mean, Dan will spec me after if he knows otherwise, but I'm pretty sure Prism puts that as a scoped per page. Jon (30:05.444) Yeah, I don't have confirmation or either way to say like, yeah, we're doing that on a page level. I know we're doing it on a window level. Allan Ritchie (30:13.841) Gotta go harass Shane. Okay, well, and you know, it's easy once you know, or you have some sort of control, you can spin those things up and go. So I wouldn't be surprised if Dan broke it down, because I know the way the navigation service works is they might want that scope to work per page. Something we're going to need to confirm, because I'm working on some stuff right now where I need to know that. Jon (30:31.044) Right. Jon (30:34.436) Yeah, yeah. I mean, I don't, I don't think we do have, I don't think we do have a page scope. I could be wrong, but I'm, I'm kind of leaning towards no, we don't. Allan Ritchie (30:42.45) It might make life easier for you guys later on, because now you can soup up optimized, because as soon as the page disposes, the container will dispose with it and clean up all that memory. As opposed to, because a window, I mean, personally, I don't use windows in, I probably should be, I have not used the window yet in Maui, only because I've become adjusted to Xamarin .Forms not having windows and... Jon (30:46.564) Yeah. Jon (31:08.868) Yeah, I mean, it depends on your use case. Most people don't need multi windows. Allan Ritchie (31:13.486) Well, there's, you know, it's funny we say that because I did find a reason the other day. Javier did like some sort of debugging library that checks the CPU. It was a really interesting concept, but he did a window overlay. So no matter what, it doesn't screw up your layout, which I thought was pretty clever. So he puts the window and puts his transparency on it. So you see your stuff, which I was like, that's. Jon (31:26.884) Mm -hmm. Yeah. Jon (31:35.684) Well, there's a whole, yeah, I mean, there's a whole API in Maui to do that too, right? And then we can add like window decorators or whatever. It's, it's actually used internally more than that's why we did it. And it's used by like hot reload stuff and, and the, and the ID so that they can like, you know, when you're like hovering over something and it outlines, you know, what that looks like on the pre the live preview, like it'll show the outline of like the controller or whatever there, there's stuff like that. yeah, some people do. Allan Ritchie (31:41.262) Yeah. Allan Ritchie (31:46.38) you cheaters. Allan Ritchie (31:58.827) I know it's up to you to use that though. I don't use it. I've never, I used it for a short period of time and I was like, yeah, it's nice. I just want to have hot reload. I'm good there. Jon (32:09.06) Yeah, there's a whole like live visual tree stuff, which it can be handy because we do show like the Maui tree hierarchy and stuff. It's kind of cool. Allan Ritchie (32:18.315) That's fair. That's advanced UI stuff for me. I'm grids and stacks if I can get grid occasionally a flex. But that's it. That's all I need. So but I did find it clever how he did the window overlay and I had never seen that concept. It doesn't make sense. So whether he can take credit for it or not I just. Jon (32:37.668) Yeah, it's pretty neat. It's a pretty like drawing based API, I think still. But. Allan Ritchie (32:42.795) I'm not sure. I'm not sure what it was. I think it was like it was at Microsoft hack week. I think this was one of the things he made. Okay. Jon (32:48.58) Yeah, yeah, no, I know which one you're talking about. What, what, what, what thing he was working on? It is pretty cool. Yeah. Anyway, the, so, you know, scope wise, yeah. Like I guess part of my point was like, we probably need to do a better job of, documenting like where those different scopes sit in Maui by default. from what I could tell, like it seems like we're doing it on modal pages because they're kind of expected to be their own. Almost, almost like a window, but not really a window. Allan Ritchie (32:56.299) Back to our. Allan Ritchie (33:17.929) You might not have a need for it. I'm 90 % sure it's a prism thing that I'm thinking of where it goes down to the page. Jon (33:18.148) Jon (33:23.396) Yeah. And, and, but that doesn't mean that somebody couldn't start creating their own scopes on the, on their own pages. Right. So. Allan Ritchie (33:28.521) Great. Well, and that's the thing, right? Like Dan's got his navigation service in Prism, so he has access to the service provider as he's newing up pages because he's in control of NavStack there. He can create a scope. In fact, I know that's now that I think about it, I know 100 % fact he's doing that because I had to write something custom recently to do that. Anyhow, it works well. It cleans up. I have to think about that when I'm doing my new Fandango the mediation stuff we were talking about in our last episode. Jon (33:37.956) Mm -hmm. Jon (33:51.492) Yeah. Jon (33:59.492) Yeah. Yeah. Allan Ritchie (34:00.745) I've been kind of farting around with that, making some good progress. I think it's gonna be interesting. But yeah, right now it's dependent on that scope, which probably is not. Jon (34:12.644) Yeah, not by default. Yeah, there's always some weird stuff when we talk about, you know, collecting things more shell maybe. Just... Allan Ritchie (34:12.712) default Maui. Allan Ritchie (34:19.4) Chill. Get involved with chill. If you're using default Maui, forget you. Jon (34:27.78) No, and I don't know if shell does either. Like the problem is like at the end of the day, we get somebody who'll be like, yeah, you, when I navigate away from this page, you know, I want this page to be disposed. And then there'll be somebody else that says, well, I don't want it to be disposed because I'm going to use it again. Allan Ritchie (34:42.632) But see, I can document my way out of that, right? It's something I've been looking at anyways. Like in the mediation, we were talking last episode about how I want to make sure that all the scopes fire on that event if they're hooked. And then if they're not hooked anymore, like the page has been disposed, they'd no fire those events. They're no longer, don't resolve them. But it means I either need to own and wrap and take over the dependency injection container to see all the scopes resolving these things. Jon (34:46.084) Yeah. Allan Ritchie (35:11.559) which I really, really, really don't want to do. Or it means I have to have a way to watch them. And there really is no way to watch them. I've come up with kind of a way to do it right now, but again, it involves the container being scoped per page so that the damn things get cleaned up. And lo and behold, here we are. That's not necessarily going to be the case. What am I going to do now? So it's all based on this thing of event collection, right? So if I see it resolve, Jon (35:28.644) Right. Jon (35:34.565) Yeah. Allan Ritchie (35:39.59) I add it to a collection that's static. And then when that view or that scope goes out of range, I remove it from the event collection so that it can continue on. If only the window scoped and there's usually only one window in a Maui app, because like me, I'm UI stupid, it's never going to clean those up. So anyway, food for thought. I'm getting close. And for every time I get close, I'm probably just going to end up taking over the DI container. I don't know. Jon (36:00.612) Well, yeah, yeah, yeah. Allan Ritchie (36:09.158) I hope not. I hope not. I don't want to. Jon (36:12.58) Yeah, I mean, well, and this kind of goes back to, I think we've talked about it before too. I really would love eventually for Maui to get some, a little bit more kind of in the box, you know, conventions on things like what occurs to me here is so you're, yeah, with Prism they're, they're handling the navigation service and everything. Right. So like, obviously they have a little bit more control over when they want to do things like. Allan Ritchie (36:33.446) Yep. Jon (36:38.884) clean up a page and clean up the scope and create a scope. And that just happens for you. But yeah, we don't really, we have the hook in a sense, but we, we, we do. But like I said, we, we run into a lot of cases where without, you know, breaking expectations from, from how things work today, you know, in a lot of ways it's like, well, yeah, you can't just, you can't just change behavior because 50 % of people are going to be mad no matter, no matter what you do. Allan Ritchie (36:46.086) You do. It's there. Allan Ritchie (36:58.884) Hmm. Allan Ritchie (37:05.556) Right. Well, the cool thing is, is that again, Dan went and wrote, because I had started to write one, because I was like, I want to see, like my hookup with my problems with Shell aren't really, I mean, I don't like the forced UI, but you don't really have to use that. Like really don't. Right. So it's like, I want Shell for the navigation and I want to just be able to plug in and take advantage of this like life cycle. So I had started something. And of course, Dan already wrote one. It's like micro MVVM or something. Sorry, Dan, if I got that wrong. I might have, I probably did, but naming sucks. Name your product better and I'll remember it. Jon (37:39.844) So he has his own another different MVVM thing or does it plug into Prism as well? Allan Ritchie (37:43.844) Yeah, he did it. No, it was like a, it was like a just a one -off thing he wanted to do that had life cycles. Basically all the problems that I have personally with Shell, he wanted the view models wired up with the page, with all the life cycle, like on appearing, on disappearing, navigation arguments, et cetera. So he just built something. I think he did it in a day. Here you go. Do whatever you want to do with it. So, which is quite clever. I've been debating using it and just... Jon (37:54.564) Yeah. Yep. Allan Ritchie (38:12.964) Not quite there yet. We'll see. But. Jon (38:15.492) Yeah, I mean, well, that's the kind of stuff that like I do myself in my own app too now, right? And this is what I'm saying. Like I'd really love to get some of that kind of stuff out of the box. Not to the point that you have to use it, but that like, Hey, if you don't want to go full prism or something and you want to just, you know, get the things that are out of the box and have, you know, a few models that have those kind of life cycle things wired up and some out of the box navigation service. Here you go. Allan Ritchie (38:27.584) Yeah, plug it in if you want it. Allan Ritchie (38:39.936) There you go. I think that's you offering away, like, I'll do it. Right? Isn't that what I heard? Jon (38:44.868) Well, I mean, well, I'd like to get there. I'd like to get there. Doesn't mean that we're, we have, you know, the, the runway to do it in the immediate future. So. Allan Ritchie (38:54.272) I didn't say yous guys, I said you. You do. Well, in any case, Dan has one. I'll look up the name of it. No, that's not it. I think he did it because it was like, here's the ultimate way to do it. If you don't have Prism, here's like, we got to look it up. He's going to give me crap after if he hears it. He doesn't even listen to this. Of course, now he will be like, dude, why don't you remember the name of it? Jon (38:57.508) No, no, yeah, no, no. Jon (39:04.42) Tiny MVVM? No, that's somebody else. Jon (39:20.896) I don't know, but that's, that is from Dan. That's like a couple years ago. Allan Ritchie (39:22.848) There you go. There. My keyboard's too clicky or I would look it up. Yeah, it's just in. I think he did it out of just spite. He was like, see, this is how you can do it. If you want to even shell it, here it is. Jon (39:33.988) Yeah. And the funny thing is like, this is, yeah, this is basically what I am saying that I want to, I want to see in the box, right? It's like some base view model. Yeah. Allan Ritchie (39:41.471) See me advertise for Dan, get Dan some sponsorships. Gotta love his stuff. Jon (39:48.324) Yeah, interesting to look at. Allan Ritchie (39:50.238) Yeah, this is it. So anyhow, this one works with all the DI stuff. I'm not sure if it pushes down the scoping stuff. I know for a fact now when I think about it, the prism is doing that. But it would be nice. Be nice. So you guys all you need is that navigation service now and the life cycles to have you on your your gold. You're gold. That's all you need. There is I was reading the page that you were mentioning. I did see the chain had mentioned like the modal pages. Jon (40:10.244) Yeah, yeah, exactly. Yeah. Allan Ritchie (40:20.478) have their own scope because it's essentially a micro window. I did find that out the hard way. That's a very interesting point. And Android fragments, though I can't think of where the heck I would ever use that. I think that was Shane going wild personally. Jon (40:23.3) Yeah. Jon (40:32.388) Yeah. Maybe I think it I think it helped with some of the implementation stuff that we had where we do a lot more with fragments now than in forms ever Like where we switched a lot of like the navigation stuff implementation to use like the Android You know navigation. I don't even know what it's called But they have newer things that are in like Android X then then were available when forms was made, right? Allan Ritchie (40:37.502) I can't. Allan Ritchie (40:44.798) Okay. Well, and that's... Allan Ritchie (40:59.294) Yeah. Yep. That's how Android rolls. They keep making newer support packages. Is it? Jon (41:03.94) Yeah. So that helped solve a lot of problems with different shell stuff and non -shell stuff, like just the way that we were basically trying to implement our own version of what Google offers now. Allan Ritchie (41:18.684) Did you age significantly from doing such implementations? Jon (41:22.052) I didn't do that one. Shane probably did. That was pretty hairy to work on, I know, but... Allan Ritchie (41:27.995) Did you just bury him in a dark room to go figure it out? Jon (41:30.596) Yeah, pretty much. That was in, I think that was between net six and net seven. And we, we kind of figured out like, can we can either keep fighting, you know, the implementation uphill or like Shane can go away for a week and like just redo it on all of the Android, you know, actual libraries and be better off for it. So. Allan Ritchie (41:49.371) push some food under the door once in a while and let him send out the dirty plates and then he comes out all like, what's the time period? Jon (41:55.204) Yeah, I think so. Yeah. So over there, we made it. But yeah, it is a little bit confusing in terms of understanding where those scope boundaries are. So that is something that, you know, in looking through this, I'm even like, we should really try and fix up, you know, the docs around that and make it more clear where that is. And, you know, if we want to give an example of like, hey, here's how you could do it with a page, but you know, you're going to have to manage creating the scope and cleaning it up when the page goes away and that kind of stuff. Allan Ritchie (41:59.515) Yeah. Allan Ritchie (42:22.427) The thing is though is that it really only applies to advanced. You really got to be digging to get into that stuff, right? Like even myself, I wasn't digging too hard until I started doing some of the stuff I'm talking about. And I don't know that you should ever be going that deep unless you truly understand it, right? Because if you get it wrong, like I've gotten dependency injection wrong on a server and it didn't show up in testing, didn't leak enough in testing. Even under performance tests, it went up, but we just assumed, you know, the stupid garbage collectors not going nuts. You start putting that under a traffic of a few hundred thousand users and it starts showing really quick that that didn't take long. And I was like, yeah, sorry, I registered that under the wrong scope. well, that's a lot of the thing to kind of go back. There was one thing I wanted to kind of say in closing is that this is where people tend to get dependency injection wrong. Jon (42:57.764) Yeah, it's not kicking in. Allan Ritchie (43:21.082) And I said it at the beginning of the episode, but people don't really understand the term pinned. it can also apply to like event delegates, like pinning. You pin the reference. It can't get out. This is the same concept actually. So if you have a singleton service or scopes, not so much a scoped, but let's say singleton, right? And you have that singleton resolve a transient. What do you think happens to that transient? That transient is now stuck there. If you've got a locked variable to it, that transient is now also a singleton. So, and there's no dispose. The container doesn't care. It doesn't watch transients. It's like, here's your manufactured can. Hope you're gonna crush it. Yep, it doesn't even attach like a handler for it to potentially deal with it in the future. It's like, it's just Pac -Man. Jon (43:52.612) Yeah. Jon (44:08.196) Yeah, here's your instance. I don't care what you do with it. Allan Ritchie (44:19.768) Out it comes, right? So you got to be careful. You really got to know what you're doing with dependency injection in states. That's why I say in Maui, I mean, really, 90 % of the time, it's a Singleton for services, just not your view models. Jon (44:37.796) Yeah, or your pages. Allan Ritchie (44:39.703) Right, you can make them transient because they're still scoped. The funny thing is that when we're talking transient pages and stuff, they're actually still scoped, kind of. Jon (44:51.492) Well, they're in under the windowscope at least, right? Allan Ritchie (44:53.975) Right so well no I mean what I mean is that they're gonna that that transient is going to stay in memory and still be disposed of by something in Maui at some point right so it's kind of pseudo scoped it's just the dependency injection container isn't going to clean it up for you so that's really what you got to look at in scoped so but you have to know you have to know where scope is being applied so just stick to singleton and transient for now. Jon (45:06.084) Yeah. Allan Ritchie (45:23.891) And if you're in Prism, it doesn't matter anyways, because Dan does it for you. And I know he's doing scoped. Pretty 90 % sure he's doing scoped, in which case it doesn't matter. You didn't know anyways, because all you did was say, I want this page to hook to this view model under this URI and do whatever the hell you're going to do. It's great. Jon (45:44.42) Yeah, now I feel like I have to go back and look at all my code and see what I used for most of them. I know I mostly am transient and singleton, so it's probably fine. Allan Ritchie (45:55.222) Are you using, you're using Microsoft extensions, right? Like just pure. It has, so one of the things you can run in like a debug mode, so you can wrap it in a compiler check is there's like validate scopes and that'll even tell you if you're doing something stupid. The reason they don't run that out of the box though is obviously dependency injection. I mean, think of it like new gets, I mean, people don't realize how hard new get versioning is to go and figure out that, that tree. Jon (45:59.264) Yep. Just the, yep, out of the box. Jon (46:09.668) Okay. Allan Ritchie (46:24.501) Right? And figure out all the versions that apply and which one it's going to get. Like it's complicated. If you've ever seen those charts, it's friggin stupid. This is the same thing, right? It's got to go, okay, this has got a dependency on those. That's got a dependency on these. Right? It's going to go through that whole hierarchy of stuff. It's not quick. It's not easy. That's like, we're going through some hardcore stuff there. So it... Jon (46:32.356) Yeah. Jon (46:36.804) Yeah, yeah, it has to figure out the order, right? Jon (46:48.26) What now where do you call the validate scopes on like I what? OK. Allan Ritchie (46:51.445) Pretty sure it's on the build service provider. So there's that extension method. That might be tough for you though, because you let Maui build that for you. So you might have to actually do the configure where it give you the service collection and then you just pass the service, the build service provider out. Jon (47:10.98) Yeah, I know there's spots in the Maui code base that we have that code enabled in some cases in debug mode. I think I've seen it for us to kind of figure out and make sure we're not doing anything wrong, right? Allan Ritchie (47:22.101) for you guys. Cheaters. I almost should add this to the template though, because I'd be, it'd be interesting because I bet you a lot of people don't understand that. Right? So if you're using the pure Microsoft extensions, it won't throw up a scoping issue until you actually resolve it. Right? So, but you also don't want to leave it as validate scopes in, in a release mode because it takes a little while. And if you've got a lot of dependencies, Jon (47:48.228) right. Allan Ritchie (47:51.733) It's gonna take a lot longer, so. Jon (47:54.276) So we do have, there is a thing in here. So if you do a Maui app and create builder, so that I think is, is that what we see? Yep. The builder has a method or extension method to configure the container. And that, yeah, so that lets you say, hey, I'll use a default service provider factory. Allan Ritchie (48:11.125) Yep, which gives you the service collection. Jon (48:20.26) and then you can pass in the service provider options there and enable validate scopes. Allan Ritchie (48:24.405) Right, so you're basically, we'd almost be doing the same call that you're doing now except providing that extra parameter. MTC validate scope. It'd probably be good to have that in the default template wrapped in a debug because I imagine a lot of people don't know that. I mean, heck, you didn't even know that, right? And it's interesting because I imagine that a lot of people go through and they're like, why didn't you do that right away? Well, because they were trying to do you a solid by making your app start up fast. Jon (48:27.652) Yeah. Jon (48:35.14) Yeah. Jon (48:40.132) Yeah, no, no, no. Jon (48:52.58) Yes, we don't want to opt you in or be opinionated on slowing down your app startup if you don't want it. Allan Ritchie (48:53.941) You Allan Ritchie (49:01.461) Well, there you go. It's a template thing. It's a template thing. Unless you use. Jon (49:03.524) Well, that's cool. Yeah, yeah, maybe, maybe. I don't know. I always hate cluttering stuff up. But maybe what we need to do is have an overload on, I don't know, on the builder, on the great builder or something. Allan Ritchie (49:13.109) Perhaps. And then just put a huge document that nobody will read. If this isn't debugged, don't set this to true. Default is false. Jon (49:20.74) But you always want to do what I told you. So maybe we did actually, and I don't think so. I was trying to think of maybe we enabled this in debug mode by default now or something, but maybe not. Allan Ritchie (49:35.157) Then people will still go, my Maui app is so slow. It's like, OK, well, man, it's got all the debug stuff wired up to it. Like, just. Jon (49:41.604) Yeah, I mean we deal with that already, so what's what's that one more? Allan Ritchie (49:43.861) Yeah, that's what I'm saying. Sometimes, I almost think sometimes you have to be able to have a flag to turn it on and off. Right? Because people expect the debug experience to be fast and they don't really understand why it's slow. Have you looked at logcat lately? my god. Jon (49:56.356) Yeah. You almost, we almost need another, like another mode that's like, you know, validation mode or something, right? Like, yeah, all the instrumentation turned on mode versus, you know, slim debug or what was the, what was the term? Allan Ritchie (50:01.429) Debug fast, debug fast, debug slow. Allan Ritchie (50:10.613) What? It might help. I don't know. we had a good term. What was it again? I don't remember any - aw, we should have written that one down, it was a good one. It was much better than Slimbinding. we're gonna - now I'm gonna have to go watch the episode, but I can't watch myself. Jon (50:27.268) Yeah, yeah. So is this supposed to throw if I have something wrong, then if I have that turned on? Yeah, I know, I don't see anything. Allan Ritchie (50:35.189) Look at your console. Do you have logging even turned on on that sucker? Jon (50:41.476) I mean, I have some stuff logging. Let's see. Maybe it's farther up in the, maybe it's earlier in the output that I'm looking. What's I'm saying? Like something should happen if I have scoping problems, right? Allan Ritchie (50:48.981) Maybe you don't have any scoping problems. Allan Ritchie (50:54.933) It's usually going to, as far as I remember, I usually don't screw up scopes anymore, knock on wood. It's possible to do, but usually when you're coding these things, it's usually when you're coding libraries where you start going, did I get that scope right? But I haven't, knock on wood, had a scope validation error in quite some time. Might even throw an exception. I'm pretty sure it throws an exception, to be honest. Jon (51:09.764) Yeah. Jon (51:17.796) That's what I was thinking, it might throw an exception. Yeah. Allan Ritchie (51:20.501) But you have to abuse it, right? Like it has to see the pin. It's like, dude, you've got a singleton, you're passing a transient into it. What the hell are you doing? Pass the iService provider and manage it then. Right, that's what they want you to do. Jon (51:30.5) Yeah. Yeah, I don't know. My scopes are great. Perfect. Best scopes ever. I'm probably leaking memory though. Who knows? Maybe not from that. Maybe from something else. Allan Ritchie (51:37.557) Are you leaking memory? Hehehehe Yeah, well, that's why we get paid the big bucks to keep fixing the stuff, right? Jon (51:47.268) Yeah, yeah. All right, well, I think that was pretty informative. I don't know which to pick in terms of a plugin package or product. Allan Ritchie (51:57.845) Can we do Dan's micro MVVM? Let's do it, let's do it, because that's on Shell. Jon (52:00.932) Yeah, sure, why not? Maui Micro MVVM. Because we could plug a DI provider, but I feel like those don't need any help. People know about them and use them. And if you don't know about them, don't go use them until you know you need to. Allan Ritchie (52:15.733) Well... Allan Ritchie (52:21.205) Let's. Well, let's plug the one because I know like don't use AutoFact in a Maui app. Just don't. It's too big. People that were using it are like, it's slow. No, no, no. That's a heavyweight. Right? AutoFact does everything and the kitchen sink. It's great for server. But for mobile, let's give Prism's favorite dry IOC. Again, I think that's a Ukrainian gent that writes that. Jon (52:29.124) Yeah, no, no, please, please. It's slow. Yeah. Jon (52:42.916) Yeah. Jon (52:48.516) Okay. Jon (52:52.58) Sure, great. Allan Ritchie (52:52.949) It's a performing container. It's mutable. I have to say mutable because Canadians go, did you say immutable or mutable? Mutable, yes, you can mutate this container. It's one container. Well, technically it's not. You can new up a new container on your own, but anyhow, whatever. That's another great one to take a look at. Jon (53:01.284) Yeah, you can mutate it. Jon (53:16.292) Okay. Yeah. Well, we'll, like I said, I usually forget to actually make the show notes. So maybe one, one of these times I will. And if not, you can go search those or, ask co -pilot about it. Probably. I'm sure it'll tell you something. Just don't. I, I, I sometimes, I mean, if I remember what, you know what I need? Cause the, the thing we use has a spot to put links associated with the episode. That's like a separate, a separate thing. what I need is for. Allan Ritchie (53:29.077) You don't put these in the show notes? Allan Ritchie (53:34.773) We're gonna get. Allan Ritchie (53:40.053) Okay. Jon (53:45.508) the tooling that we use to record to like call out and be like, Hey, here's the, here's the thing you said you were going to link to, right? We need some more AI. Allan Ritchie (53:53.781) You could always let me do some of these things. You tend to micromanage the administration stuff. I can always do some of the admin stuff. Jon (53:58.596) I think you have access to that one, so you can go add all the links you want to your heart's content. Allan Ritchie (54:01.589) listen, I just had. So today, just for funny, ha ha ha, I moved all my microphone around. People love to hear this stuff because, you know, when I do stupid things, I'm supposed to be smart. I'm not sure if I am or not. The jury is always out on that. But today I moved my microphone because it's been constantly like you can see it now. OK, it's right there. Jon (54:25.252) Well, maybe I don't know if the still do videos yet. The, the yeah. Allan Ritchie (54:28.149) Well, you've been complaining like, dude, talk into your mic. And I'm like, I'm just talking. I don't know why is it. Why do I have to lick the microphone for it to hear me? No, I'm not a singer. Nobody wants to hear me sing. So why do I have to go? Right. OK, well, I'm close enough now. Nobody's complaining anyhow. So today I decided to to rewire it. And I know you have to leave some like some extra wire and attention. And I did. Jon (54:34.34) No, you got to get right into it because. Jon (54:42.98) Yeah, because you have to. That's physics. Allan Ritchie (54:58.293) But when I moved the arm, the arm decided, no, there's not quite enough tension for me. So it pulled all the wires tight. And when I moved the microphone down with my finger, the stupid micro USB in my $350 microphone bent like nothing. And then I was like, huh, why isn't my microphone on? Why isn't my microphone on? I don't know. So John's like, are you coming? Are you coming? Are we doing this? Are we doing this? I'm like, I think I just botched my microphone. Jon (55:20.996) Has the USB pins bent off the board? Wait, let me run to the store and spend a bunch of money. Allan Ritchie (55:30.213) Well, no, hang on, hang on. I got another micro USB cable. I plugged it in. Nope. Got another one. Nope. I tried to pull open the original one. I was like, OK, yeah, the wire's broken. I quickly tried to rig it up, got it connected, plugged it back in, and the microphone just started blinking. I'm like, this is not good. And John's been like, are you going to get that XLR? I called it a DLR. I don't know. I'm not sure what I was thinking. Jon (55:56.516) It's like a hybrid between a DSLR and XLR. Allan Ritchie (55:58.549) And he's like that I'll give you power. So I'm like, okay, I'm going to go get one of those things. And he's like, well, you could just get this one for 200 bucks or here's the Mecca. That's like huge. It's huge. So I got back. I'm like, you know what? I'll just get the expensive one that John's been bugging me to get. No, this one's pretty cool though. But then the funny part is John had to call me because I couldn't hear him and we had to do a FaceTime to figure out how to set this thing up in record time. Jon (56:10.468) Yeah, it's massive. I told you it was overkill, I told you just to get the other one. Allan Ritchie (56:28.205) and it was one stupid button that looks like an ear at the bottom that I just had to press. And John was screwed up. It took us probably what a half an hour to fix this damn box. Jon (56:35.488) yeah. And we still don't. I mean, I still don't truly understand why, why mine was working without that setting and yours was not because they're the same thing, but you know. Allan Ritchie (56:40.076) It jobs like, this should be working. Allan Ritchie (56:45.196) It is pretty intuitive when you look at it. You're like, well, I guess that makes sense. And I found it by accident because I was like, in order for me to hear myself, I had to press this button. So on this input, I have to press that button as well. I can hear stuff now. Jon (56:57.86) Yeah, I, I, I now I'm starting to feel like my thing is set up wrong because like, I mean, it works fine with those things on, but like, if I, if I turn them off, it, the, the one of the things still, yeah, anyway, I'm going to play with it now. Cause now I feel like mine's wrong and I, I want it to be right. Allan Ritchie (57:02.662) nice. OK. Well. Allan Ritchie (57:16.556) Good, well, I don't feel bad for you now, because you're like, yeah, you could just get this one. And of course, you're like, yeah, go big, go big, go get the big one. So I got the big one. That's pretty cool. It's some sort of road. I don't even know what it's called. Road. That's the brand. Well, I mean. Jon (57:23.844) No, no, no. Jon (57:30.148) I don't know what it's called, I just bought it, but it has all the fun effects, right? Like I can yell at Alan over my megaphone. Allan Ritchie (57:37.58) see that's cool I have no idea how to do that yet because... Alright. Well next it's gonna get annoying now because now you've given me a toy. Jon (57:39.908) You'll learn. Yeah. yeah. yeah. Now we're going to, it's just going to be all the episodes of like, where can I use the effect? Allan Ritchie (57:48.14) So again, you've been a bad influence on me getting new toys, although I was looking for a new toy to be honest, and I've got one. But you know, next time you go to Disney, you owe me some Mickey ears or a friggin lightsaber, man. Well, your kids are getting there. You're gonna get a lightsaber. It's I think you can see it, but they're back. They're right back in here up on the top of the show. Jon (57:54.98) Yeah, see, there you go. Hmm... Hmm... Maybe, we'll see. I'll see, to be continued. Jon (58:09.892) I got to go steal my kids droids and put them up here. Allan Ritchie (58:13.833) yeah, see they won't care about that stuff anymore. That's like the Lego Mario. I have the Lego Mario back there because my son was like, I don't like Mario anymore. I'm like, well, you're not getting rid of it. That's mine. It's mine now. My toy. All right. That was funny. People find it funny that we screw up to and don't know how to use intuitive interfaces, even though that's kind of what we do for a living partially. Jon (58:16.676) Now it's done. Jon (58:22.628) Yeah. Yeah. Okay. Fine. I'll take that off your hands. Thanks. yeah. All right. That's enough. Jon (58:34.628) yeah, no, and I'm not an audio engineer either as it turns out, even if you have all the fancy dials and stuff and you don't know how to use them. So. Allan Ritchie (58:44.168) That's where we are. Jon (58:45.508) Well, on that note, you know, if there are audio engineers that would like to tell us how poorly of a job we're doing with the audio, and actually we are, cause last episode my mic was screwed up and it was a horrible thing to listen to. Cause I, I windows raised the input volume on me and I didn't check. I have to check every episode just in case something auto bumped it up. So it was like really peaking and stuff. So I'm sorry that that was pretty bad. Allan Ritchie (59:12.712) At least it's not me this time. You keep blaming me. No, it's not me. I don't think. Jon (59:14.708) Yeah. Yeah. So last episode, if we asked you to leave a review, hopefully you didn't because the sound quality was really terrible and you would have left like a two star review. So hopefully fingers crossed this, this one's better and you can go ahead and leave that five star review instead this time. Allan Ritchie (59:34.192) Now it sounds like I'm in your ear. Like right in your ear. I don't know if that's creepy or not. Jon (59:36.548) Exactly. It's like a nice little quiet, you know, fireside chat with your coffee, roasting marshmallows, looking up at the stars. Yeah. Or they've already tuned out anyway, so that's probably more, more of the case and ideal. Exactly. All right. So go to gonmobile .io. You can get links to all the things. you can let us, you know, give us some feedback if you'd like. If not, you know, the five star review will do. Allan Ritchie (59:44.776) Now they think you're weird and they're not gonna listen anymore. Alright. Yeah, we're not talking tech anymore, so people are bored. Jon (01:00:06.788) Thank you all, see you later. Thanks, Alan. See you next time. Bye. Allan Ritchie (01:00:09.416) down for now.