cryptocurrencyappyt's People
Forkers
navalkishor virendersran01 rikharthu usherzod1994 youri007full 80211android goldaev yfmacit didahdx yuchailam rayalois22 efrainlm longpham2310 naufalrachmandani famzy catzilla312 jido2015 adityapatnaik kazimdsaidul fredy16030 imen-nmn pierrevieira michaelsam94 jalalmadhaji xiaoxiaohaozai bosankus keithgapusan chavdabrijesh azmanabdlh ngocann erfanmhat tktschool ihebchiha guyshoham aminovicnouri zeratel ckrudals ibfaye dalakoti07 nejmenn rogerwang2015 jesmanto venitoprada8 siddhantsharma575 iamset adriandleon applejack4 gael-android prafullashekhar realityexpander drcode99 ktirumalsetty samou1544 nopyjf neerav006 munizeraa phamdat080598 anasalqassim jeffbs andrewpedia aguskhaer02 rashedulhasan-dev szpori rsyanting sunny52525 kururu-abdo furkanbeykoz rksharma89 anubhav100rao ansuman87 bfk78 praveen-gm gsoultan vsh15 elliptic1 randyahx iharishvarmawork siaelodi marktarjan farihazultana vadym-m ibrahimafridi7 ceyton kktadena killonstar mihaicapra kiwamizamurai danilo-miguel mahmoudmabrok guptarahulone abcrop vivekshaw danny-hoang alexsalvatore naveen353 nicholasbassett1991 karencalulo0012 va3mezk kabirnayeem99 anisha-24cryptocurrencyappyt's Issues
No type arguments expected for class Flow
Line 17 @GetCoinsUseCase
Close empty repos
Close empty repos
issue
Paging?
How and where would you implement paging to this project using this approach?
The
My comments on Clean Architecture
Hi there. I really like your videos. I've been practising Clean Architecture for some years, but as you know the implementation is open to interpretation, so I'm always interested in other people's perspective. This issue is just a comment/request for opinion (and not a critic!).
Some points I think could be more aligned with Clean Architecture:
-
Data DTOs: I'd try keep the DTOs pure and anemic, without those
toDomainVersion
convenience functions. The DTOs change with the API while the domain objects change with domain changes. This mapping could be better contained in a different file to decouple both models, although it is Ok if you are 100% sure there will be no changes. -
Data repository: I would have kept it synchronous (no suspend, no LiveData, no nothing!). Right now you are coupling your interface to a particular async library (Coroutines). But in Clean Architecture you usually want to postpone these decissions for later. You might want to use RxJava or whatever other library. This choice can be made later in a more external layer (domain or better yet, application). This also makes testing of the data package easier, and makes porting it to a different technology also a lot easier.
-
Domain model:
Coin
andCoinDetail
are two different classes, but in real lifeCoinDetail
is also aCoin
, just with extra info, and you are not expressing this relationship in the code.
I'd have created just a singleCoin
class with an optionalDetails
member inside, that could be retrieved as needed.
I like that you have kept them immutable and pure Kotlin. If you were implementing persistence, don't add here all those Room annotations. Create instead a separate persistence model in the data package. -
Domain "use cases" (actually Domain Services): These two existing use cases could be fused into one single class, a
CoinService
, with two methods. Also notice that there is no significant domain logic whatsoever in these use cases, so for this particular sample app you could get rid of this layer and go straight for an application layer (or even the ViewModels) to wrap your repository calls into async constructs (although in your case they were already async) and handle exceptions. The domain layer is mostly meant for "business transactions", pure domain methods that don't belong in a particular domain class. Calling the network or retrieving from persistence is not really something specific of the domain (the coins). -
DI: Use it only on your external layers. No
@Inject
annotations polluting your inner classes (eg:CoinRepositoryImpl
). Believe it or not, you can also decide to change your DI library some day, and we don't want the entire code base to be tied to it.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.