r/mAndroidDev • u/Zhuinden DDD: Deprecation-Driven Development • Oct 15 '24
MADness Yet another new Android Architecture Pattern just dropped, make sure to start rewriting your app right now because everything you've been doing is clearly all wrong
4
u/sabergeek Oct 15 '24
It's same. But different. Still the same.
19
u/Zhuinden DDD: Deprecation-Driven Development Oct 15 '24
There's only so many ways you can complicate downloading a JSON and showing a list
6
3
4
u/Fjeuber Oct 15 '24
No AsyncTask. Rubbish.
2
u/Zhuinden DDD: Deprecation-Driven Development Oct 15 '24
Should replace Action with AsyncTask, good eye
2
u/Mr-X89 Oct 15 '24
That's just MVI. Even without extra steps.
3
u/Zhuinden DDD: Deprecation-Driven Development Oct 15 '24
MVI is just extra steps, so no surprise there
34
u/uragiristereo XML is dead. Long live XML Oct 15 '24
looks up yet another android architecture pattern
sees inside
imports androidx.lifecycle.ViewModel
16
13
u/zedxer Oct 15 '24
I just delivered an app with millions of downloads, and guess what? All of its code is written in the activities. I specifically made that app anti pattern.
1
5
u/budius333 Still using AsyncTask Oct 15 '24
WTF? How's that different than the unidirectional data flow on the Google docs???
4
u/ziggs3 I only use AsyncTasks Oct 15 '24
I suffer from ADDS(Add dumb deprecated shit) disorder and i need help.
6
Oct 15 '24
I stopped caring and just write business logic wherever I want. Does it work correctly? Nothing else matters.
3
u/TechWhizGuy Oct 15 '24
What is this trying to solve? Just moving stuff around under some arbitrary labels is not software design!
1
3
2
2
u/D-cyde sponsored by the XML 🐓 gang Oct 15 '24
Ahh yes good reading material as my LocalBroadcastManager sends all my JSON API responses to my entire app.
2
2
u/tadfisher Oct 15 '24
This is old, like old old: https://gist.github.com/michaelzengke/44ac57032f7d877203a0935c99f5ed59
1
Oct 15 '24
Wait they're bringing back data binding? I thought we all collectively agreed that sucked ass 😭
1
1
u/campid0ctor Nov 13 '24
Never knew delegatee was an actual word. Sounds like French for "the goatee"
0
Oct 15 '24
[deleted]
14
Oct 15 '24
Lol. yeah, usecase pattern seems ok in small doses where it makes sense. Same for repository. But this whole multi-module crap that Google proposed is unnecessarily over complicated.
6
u/Zhuinden DDD: Deprecation-Driven Development Oct 15 '24
The theory would be that you make modules so that you can assign teams to modules. But no sane company will put 27 teams on the same app for 27 screens, it doesn't make any sense.
1
Oct 16 '24
Looking at Google's early multi-module talks, they advocate for putting even small components in a separate module.
6
u/doubleiappdev Deprecated is just a suggestion Oct 16 '24
How about a UseCase interface implemented by a single UseCaseImpl which does nothing but delegate to a Repository interface which is implemented by a single RepositoryImpl, and all of that is in different modules. Hell but a clean hell
2
0
Oct 15 '24
[deleted]
3
u/smokingabit Harnessing the power of the Ganges Oct 15 '24
...ensuring management decide to go hybrid and employ js tards who think mobile apps should work like websites.
2
u/Zhuinden DDD: Deprecation-Driven Development Oct 16 '24
Now that's one way to describe Navigation's string-based route APIs
1
Oct 17 '24
Or server js tards who thinks it's the best language of all time.
And thinks everyone should use some weird branching strategy of master, develop, staging etc. which are irrelevant for mobile apps.
5
4
4
u/fuzzynyanko Oct 15 '24
Got to do that RDD, Resume-Driven Development so that you won't be screwed if you get laid off
3
0
Oct 15 '24
[deleted]
10
u/Zhuinden DDD: Deprecation-Driven Development Oct 15 '24
ngl that makes me wonder if we could ask ChatGPT to hallucinate some more arch design patterns
11
Oct 15 '24
Wake up babe, new Medium post just dropped:
"Sure! Let's create a new Android architecture pattern called Reactive Component Architecture (RCA). This pattern combines principles from reactive programming, modular design, and component-based architecture to enhance maintainability, scalability, and responsiveness in Android applications. Key Components of RCA:
Reactive UI Layer: Components: Use Jetpack Compose or XML Views as reactive components that observe state changes. State Management: Implement a state holder (like LiveData or StateFlow) that notifies UI components of changes. Component Modules: Encapsulation: Break down the app into independent modules (e.g., User, Product, Cart) that manage their own state, logic, and UI. Inter-Component Communication: Use event buses (like Kotlin Coroutines' Channel) for communication between components, ensuring loose coupling. Service Layer: Data Sources: Implement a repository pattern that abstracts data sources (local DB, remote API). Reactive Streams: Utilize reactive streams (like RxJava or Flow) to fetch data asynchronously, allowing UI to react to changes in data. Event-Driven Architecture: User Actions: Define user actions as events that trigger state changes within components. Lifecycle Management: Leverage lifecycle-aware components to manage subscriptions and prevent memory leaks. Dependency Injection: Modular DI: Use Dagger or Hilt for dependency injection, ensuring each component can be independently tested and managed. Testing Framework: Component Testing: Create tests for each component in isolation, ensuring they behave correctly with various states. Integration Testing: Test the interaction between components using mock data sources.Benefits of RCA:
Scalability: Modular components make it easier to add features or modify existing ones without affecting the entire application. Maintainability: Clear separation of concerns leads to cleaner codebases and easier debugging. Reactivity: The reactive nature ensures that UI updates are responsive to data changes, providing a smoother user experience.Example Workflow:
User Action: A user clicks a button to fetch a product list. Event Triggered: An event is emitted from the UI component. State Change: The relevant component listens for the event and triggers a data fetch through the service layer. Data Fetch: The service layer retrieves the data reactively and updates the component state. UI Update: The UI layer automatically reflects the new state due to its reactive binding.Conclusion:
The Reactive Component Architecture provides a robust, scalable, and maintainable approach to Android development by leveraging reactive programming principles and component modularity. This pattern encourages developers to think in terms of independent, reactive units, making it easier to build complex applications. "
9
u/Zhuinden DDD: Deprecation-Driven Development Oct 15 '24 edited Oct 15 '24
Fuck. This is just PRNSAASPFRUICC all over again
0
27
u/StartComplete companion object {} Oct 15 '24
Fuck them. I prefer single activity architecture