All Projects → CassiusPacheco → Swift Cleanarchitecture

CassiusPacheco / Swift Cleanarchitecture

Simple Swift project applying concepts inspired on the Clean Architecture

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swift Cleanarchitecture

Modular Monolith With Ddd
Full Modular Monolith application with Domain-Driven Design approach.
Stars: ✭ 6,210 (+4569.17%)
Mutual labels:  architecture, clean-architecture
Swift Design Patterns
🚀 The ultimate collection of various Software Design Patterns implemented in Swift [Swift 5.0, 28 Patterns].
Stars: ✭ 85 (-36.09%)
Mutual labels:  architecture, clean-architecture
Ios Clean Architecture Mvvm
Template iOS app using Clean Architecture and MVVM. Includes DIContainer, FlowCoordinator, DTO, Response Caching and one of the views in SwiftUI
Stars: ✭ 753 (+466.17%)
Mutual labels:  architecture, clean-architecture
Go Cleanarch
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
Stars: ✭ 434 (+226.32%)
Mutual labels:  architecture, clean-architecture
Polysemycleanarchitecture
Showcasing how the Polysemy library can be used to implement a REST application conforming to the guidelines of the Clean Architecture model.
Stars: ✭ 106 (-20.3%)
Mutual labels:  architecture, clean-architecture
Viabus Architecture
让 Android 开发可以像流水线一样高效的,职责分离架构 ⚡ 不同于 MVP 的配置解耦,也不能和 似是而非 的 MVVM - Clean 同日而语。VIABUS 是世界范围内首个明确提出,通过职责分离,来真正实现 UI 和 业务并行开发的 Android 项目级开发架构和设计模式理念。
Stars: ✭ 485 (+264.66%)
Mutual labels:  architecture, clean-architecture
Cleanarchitecturetemplate
A template for a dotnet core api / mvc "clean architecture" project.
Stars: ✭ 50 (-62.41%)
Mutual labels:  architecture, clean-architecture
Cleanaspnetcorewebapi
Starter project for creating APIs built on ASP.NET Core using clean architecture.
Stars: ✭ 279 (+109.77%)
Mutual labels:  architecture, clean-architecture
Android Kotlin Clean Architecture
Android Sample Clean Architecture App written in Kotlin
Stars: ✭ 1,562 (+1074.44%)
Mutual labels:  architecture, clean-architecture
Dev Stuff
😎 Programming stuff for everyone. Collection of articles, videos about architecture, Domain Driven Design, microservices, testing etc.
Stars: ✭ 105 (-21.05%)
Mutual labels:  architecture, clean-architecture
Go Clean Arch
Go (Golang) Clean Architecture based on Reading Uncle Bob's Clean Architecture
Stars: ✭ 5,128 (+3755.64%)
Mutual labels:  architecture, clean-architecture
Go Bank Transfer
Simple API for banking routines using a Clean Architecture in Golang. 💳 💰 💸
Stars: ✭ 123 (-7.52%)
Mutual labels:  architecture, clean-architecture
Clean Architecture Zh
《架构整洁之道》中文翻译
Stars: ✭ 299 (+124.81%)
Mutual labels:  architecture, clean-architecture
Android Showcase
💎 Android application following best practices: Kotlin, Coroutines, JetPack, Clean Architecture, Feature Modules, Tests, MVVM, DI, Static Analysis...
Stars: ✭ 5,214 (+3820.3%)
Mutual labels:  architecture, clean-architecture
Cleanarchitecturerxswift
Example of Clean Architecture of iOS app using RxSwift
Stars: ✭ 3,256 (+2348.12%)
Mutual labels:  architecture, clean-architecture
Cleanarchitecture
Clean Architecture Solution Template: A starting point for Clean Architecture with ASP.NET Core
Stars: ✭ 8,945 (+6625.56%)
Mutual labels:  architecture, clean-architecture
golang-starter
Golang code boilerplate inspired by clean architecture
Stars: ✭ 49 (-63.16%)
Mutual labels:  architecture, clean-architecture
Kotlin Modular Tdd Coroutines Mvvm
A sample Kotlin app which was built with modular structure, Kotlin DSL, Kotlin Coroutines, TDD and MVVM patterns.
Stars: ✭ 256 (+92.48%)
Mutual labels:  architecture, clean-architecture
Ios Architectures
Sample app for iOS architectures
Stars: ✭ 90 (-32.33%)
Mutual labels:  architecture, clean-architecture
Deptrac
Keep your architecture clean.
Stars: ✭ 1,784 (+1241.35%)
Mutual labels:  architecture, clean-architecture

The Clean Architecture

This sample project is inspired on The Clean Architecture by Uncle Bob.

Its main goal is to follow the SOLID principles in order to keep the software well organised, testable, easy to maintain and more importantly easy to extend/change.

As explained in the posts above and in the book, databases, network clients and frameworks are abstracted in the upper layers (Entities, Data and Domain layers) and should not be imported/referenced into them, instead they should be injected in the App level as dependencies through the interfaces exposed by the upper layers.

graph

Modules

In this sample app we have the following modules/layers:

DependencyInjector

Framework responsible for linking the Interfaces to the Factories. This should only the referenced/used in the App Module.

Entities

Top level module. This should not have access to any other module in the system and must be the simplest possible.

Data

Responsible for exposing a few Interfaces for external plugins implementations such as databases, memory caches, network, bluetooth, etc. This should not reference any concrete class related to these. It also contains the Repositories which are another abstraction for the use of the plugins mentioned above. This module can only access Entities layer, nothing else.

Domain

This module exposes UseCases to process business logic using the Command Pattern. The use cases must be simple and have only one responsibility. They usually communicate with Repositories from the Data layer through Interfaces. Ideally UseCases would return DataStructures instead of Entities to the lower layers, since these could contain UI-specific data which isn't part of the Entities layer.

App

In this layer we have all the code that's specific to the platform of development. In this sample project the platform is iOS, furthermore a concrete implementation of the CacheInterface exposed by the Data layer was implemented in the App layer using UserDefaults as the persistence choice, for example. This layer may have ViewModels, Coordinators, ViewControllers, Views, third party frameworks and, finally, is also responsible for setting up the dependency graph for the project by linking all the interfaces to their respective concrete classes.

Tests

Even though I haven't written any tests yet, the whole project is completely testable, since all layers are being isolated by interfaces, as suggested by the SOLID principles.

Getting Started

Prerequisites

  • Xcode 11.3.1
  • iOS 12
  • Swift 5.1

Installing

The project uses Swift Package Manager for dependency management. Just open SwiftCleanArchitecture.xcworkspace, select the App target and run it.

To check out the legacy example built with Carthage, have a look at this branch.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].