Mallikarjuna Chilakalaโ€™s Post

View profile for Mallikarjuna Chilakala, graphic

iOS Developer having around 10+ years of experience | SwiftUI | Swift | Objective-C | MVC | MVVM | Clean Architecture| TCA | Xcode | TDD | GitHub | CI/CD | Agile methodologies | SOLID principles

๐—ฆ๐—ผ๐—ณ๐˜๐˜„๐—ฎ๐—ฟ๐—ฒ ๐—”๐—ฟ๐—ฐ๐—ต๐—ถ๐˜๐—ฒ๐—ฐ๐˜๐˜‚๐—ฟ๐—ฒ ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป๐˜€: ๐— ๐—ฉ๐—–, ๐— ๐—ฉ๐—ฃ, ๐— ๐—ฉ๐—œ, ๐— ๐—ฉ๐—ฉ๐— , ๐—ฉ๐—œ๐—ฃ๐—˜๐—ฅ Design patterns are essential tools for any developer, offering a framework for structuring code in a clean, maintainable, and scalable way. Today, we'll delve into five of the most popular design patterns, exploring their strengths and weaknesses to help you choose the right fit for your next project. ๐— ๐—ฉ๐—– (๐— ๐—ผ๐—ฑ๐—ฒ๐—น-๐—ฉ๐—ถ๐—ฒ๐˜„-๐—–๐—ผ๐—ป๐˜๐—ฟ๐—ผ๐—น๐—น๐—ฒ๐—ฟ): - Classic pattern separating code into three layers: ย ย ย ย - ๐— ๐—ผ๐—ฑ๐—ฒ๐—น: Data and business logic ย ย ย ย - ๐—ฉ๐—ถ๐—ฒ๐˜„: Presentation of data to the user ย ย ย ย - ๐—–๐—ผ๐—ป๐˜๐—ฟ๐—ผ๐—น๐—น๐—ฒ๐—ฟ: Handles user input and updates model/view - Simple and familiar, but can lead to tightly coupled components in complex applications. ๐— ๐—ฉ๐—ฃ (๐— ๐—ผ๐—ฑ๐—ฒ๐—น-๐—ฉ๐—ถ๐—ฒ๐˜„-๐—ฃ๐—ฟ๐—ฒ๐˜€๐—ฒ๐—ป๐˜๐—ฒ๐—ฟ): - Introduces a Presenter to mediate between view and model. - Improves separation of concerns and testability. - Requires additional boilerplate code compared to MVC. ๐— ๐—ฉ๐—œ (๐— ๐—ผ๐—ฑ๐—ฒ๐—น-๐—ฉ๐—ถ๐—ฒ๐˜„-๐—œ๐—ป๐˜๐—ฒ๐—ป๐˜): - Built for reactive programming. - View emits intents, handled by the model, updating state and view. - Promotes unidirectional data flow and simplifies UI logic. - May require a steeper learning curve. ๐— ๐—ฉ๐—ฉ๐—  (๐— ๐—ผ๐—ฑ๐—ฒ๐—น-๐—ฉ๐—ถ๐—ฒ๐˜„-๐—ฉ๐—ถ๐—ฒ๐˜„๐— ๐—ผ๐—ฑ๐—ฒ๐—น): - View binds to a ViewModel holding data and display logic. - ViewModel updates by the model, then updates the view. - Well-suited for reactive frameworks and complex UIs. - Requires additional ViewModel setup compared to MVP. ๐—ฉ๐—œ๐—ฃ๐—˜๐—ฅ (๐—ฉ๐—ถ๐—ฒ๐˜„, ๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐—ฎ๐—ฐ๐˜๐—ผ๐—ฟ, ๐—ฃ๐—ฟ๐—ฒ๐˜€๐—ฒ๐—ป๐˜๐—ฒ๐—ฟ, ๐—˜๐—ป๐˜๐—ถ๐˜๐˜†, ๐—ฅ๐—ผ๐˜‚๐˜๐—ฒ๐—ฟ): - Designed for large and complex applications. - Five layers: View, Interactor (business logic), Presenter (data preparation), Entity (data models), Router (data flow coordination). - Enhances modularity and maintainability for massive projects. - Requires meticulous planning and understanding due to its complexity. ๐—–๐—ต๐—ผ๐—ผ๐˜€๐—ถ๐—ป๐—ด ๐˜๐—ต๐—ฒ ๐—ฅ๐—ถ๐—ด๐—ต๐˜ ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป: The optimal pattern depends on various factors, including: - ๐—ฃ๐—ฟ๐—ผ๐—ท๐—ฒ๐—ฐ๐˜ ๐˜€๐—ถ๐˜‡๐—ฒ ๐—ฎ๐—ป๐—ฑ ๐—ฐ๐—ผ๐—บ๐—ฝ๐—น๐—ฒ๐˜…๐—ถ๐˜๐˜†: MVC/MVP for simple apps, MVI/MVVM for reactive apps, VIPER for large projects. - ๐—ง๐—ฒ๐—ฎ๐—บ ๐—ฒ๐˜…๐—ฝ๐—ฒ๐—ฟ๐—ถ๐—ฒ๐—ป๐—ฐ๐—ฒ: Choose a pattern familiar to your team to avoid learning curves. - ๐—ฃ๐—ฒ๐—ฟ๐˜€๐—ผ๐—ป๐—ฎ๐—น ๐—ฝ๐—ฟ๐—ฒ๐—ณ๐—ฒ๐—ฟ๐—ฒ๐—ป๐—ฐ๐—ฒ: Experiment and find what works best for you and your team. Ultimately, experimenting and finding what works best for you and your team is key. What do you think? Which software architecture pattern is your favorite?

  • No alternative text description for this image
Romain Brunie ๐Ÿ“ฑ๐Ÿ”ฅ

I help you master TCA with daily insights ๐Ÿš€ | iOS Software Engineer @ AVIV

4mo

As long as you follow SOLID principles, I would say that it does not really matter what architecture you work with, complications will disappear

Ben Shern

Sr Java Engineer at Phase Change AI

4mo

People get kind of hung up on these patterns somehow being the โ€œrightโ€ way but the reality is these are based on ancient Windows apps running in a single dialog box. Itโ€™s time to move past these and model how apps really work today.

Brian Cameron

Senior Systems Engineer / Network Infrastructure / Virtualization / Hybridization

4mo

w0w, Hey! Merry Christmas !!! This is real cool \\ thanks for coming here and sharing this with us.. Please keep coming back and sharing here on this POST.. And who knows maybe there will be a few take aways for y7ou as well.. :|||: \\\lol/// :|||: Thank you MAN ;) p.s. we always though of the lower case " Laugh Out Loud " was our little 'TIE FIGHTER " not everyone gets that right away. Thanks BRO!

Like
Reply
Sajo Sunny

Software Engineer at Yatnam technologies

4mo

First diagram definitely wrong, Since model and database have direct interaction.

Martin Berger

iOS and Flutter Developer at BrightMarbles

4mo

Don't care which one it is as long as once a pattern is selected it is used across all features :D Thnig that needs to be solved is how to deal with common code, for example code that two Controller classes share... Make a base Controller or use some extension mechanism, or isolate code in Command classes or ... Every time I think about what to do with common code ๐Ÿ˜€

Like
Reply
Rakesh Kumar

iOS Engineer at Globant India Private India

4mo

In given MVC digram, how user direct communicate with controller? I think, user will first interact with View.๐Ÿ˜

Aleksander Prudnik

Associate Professor | Research Group Lead | Exploring the path from ideation to productization

4mo

M returns to C without any requests? It contradicts to the meaning of the word "return".

Like
Reply
Alessandra Vieira

Full-Stack Developer | Javascript | Typescript | HTML | CSS | Angular | Node.js | Git & Github | Cyber security

4mo

Joรฃo Pedro Reis Felini Que interessante, isso com certeza pode nos ajudar a estudar as coisinhas de cybersec q a gente tava comentando antes

Like
Reply
Dimas Prasetyo

Frontend Developer | Fullstack Developer | Angular | React | Vue | Ex Investree

4mo

I wonder ! I"m really appreciate what you shared and to explain to Mallikarjuna Chilakala awesome Dude !

Like
Reply
Habib Ur Rahman

I'm Management Director at WebMorphix. Full stack Developer || Graphic Designer || Web Designer || SEO || WordPress Developer || Content Writer || Logo Designer

4mo

Let's Connect

Like
Reply
See more comments

To view or add a comment, sign in

Explore topics