-
-
Save rix0rrr/c62ac7c5bbc2f6f16b695865bb76c30e to your computer and use it in GitHub Desktop.
| // Simple case, my "app" is just a stack | |
| const app = new cdk.App(); | |
| new MyStack(app, 'MyFrobulizerConsumer'); | |
| //--------------------------------------------------------------------------- | |
| // More complex case, my "app" is a subclass of App because it contains multiple | |
| // stacks and I can organize them | |
| new MyApp('TweetFrobulizer'); | |
| //--------------------------------------------------------------------------- | |
| // Instantiating multiple apps or the same app multiple times | |
| new MyApp('TweetFrobulizerEU', { ... }); | |
| new MyApp('TweetFrobulizerUS', { ... }); | |
| new OpTools('TweetFrobulizerTools'); |
| // Simple case, my "app" is just a stack | |
| // ==> This is the same | |
| const app = new cdk.App(); | |
| new MyStack(app, 'MyFrobulizerConsumer'); | |
| //--------------------------------------------------------------------------- | |
| // More complex case | |
| // I still need to instantiate a boilerplate thing that has nothing to | |
| // do with *MY* code | |
| const app = new cdk.App(); | |
| new MyApp(app, 'TweetFrobulizer'); | |
| //--------------------------------------------------------------------------- | |
| // Instantiating multiple apps or the same app multiple times | |
| // Again, this boilerplate thing is here | |
| const app = new cdk.App(); | |
| new MyApp(app, 'TweetFrobulizerEU', { ... }); | |
| new MyApp(app, 'TweetFrobulizerUS', { ... }); | |
| new OpTools(app, 'TweetFrobulizerTools'); | |
| // So the difference as I see it is in the simple case, we can retcon that | |
| // the App you instantiate is actually *your* app, and we can hide the | |
| // machinery of coming up with a proper (shared) Root instance inside that class. | |
| // | |
| // Whereas in the other scenario, you HAVE to instantiate that Root object, | |
| // but it's obviously framework machinery sticking out. | |
| // | |
| // Now the downsides of making users subclass App is that: | |
| // 1) The signature will be slightly different from construct, which will be | |
| // confusing. | |
| // 2) Their stuff isn't as obviously reusble as when it was a cdk.Construct. | |
| // | |
| // Mitigations for making the `App` class stick out like that: | |
| // 1) Rename it? But to what? | |
| // 2) Static singleton accessor? But named what? Probably shouldn't involve | |
| // the word "root" anywhere or we're going to get back into tree building | |
| // discussions that we don't want to have. | |
| const host = new cdk.Host(); | |
| // or | |
| const model = new cdk.AppModel(); | |
| // or | |
| new MyStack(cdk.Host.root, 'MyStack'); | |
| new MyStack(cdk.App.appScope, 'MyStack'); | |
Great breakdown of design tradeoffs. Using App as a lightweight wrapper keeps projects simple, while CDK boilerplate supports scalability and reuse. Teams should choose based on complexity and collaboration needs, not trends or shortcuts like fake phonepe apk examples online.
The 1-app-is-your-app.ts module is designed to simplify app management and improve user experience by integrating seamless storage and backup functionalities. For users exploring cloud solutions, learning how to backup photos using TeraBox app becomes straightforward, allowing automatic syncing, secure storage, and easy access across devices. By combining intuitive interface features with reliable performance, this approach ensures your important files remain safe without manual effort. Developers and users alike benefit from the structured setup, making file handling, photo backup, and app integration efficient and reliable for everyday digital needs.
“This comparison nicely highlights the practical difference between using App as your own application wrapper versus treating it as pure CDK boilerplate. The first approach feels cleaner for simple architectures, while the second exposes more framework machinery and can look heavier. Both patterns work it really depends on how reusable or structured you want your stacks and constructs to be.”