For anyone don't understand what "deltas" mean in 4:53: request deltas likely means asking the server for information on what has changed since the last request.
@andrey_tech
9 ай бұрын
Good catch!
@dragonzhao433
8 ай бұрын
also for the DataSource part is bit unclear, why we not store seen/unseen in data model? and why is there ViewModel inside datasource if we using MVP? feel like it will be much more straiforward to directly store status of seen/unseen in data model and update it from service to generate new list for display
@483SGT
2 ай бұрын
I don't quite get why UIPageViewController wouldn't work here. Can you explain a little more please?
@andrey_tech
2 ай бұрын
UIPageViewController doesn't provide infinite horizontal scrolling. Usually we use UIPageViewController for horizontally sliding views but user can only slide and go from 1st page to the last one and then user needs to swipe back one by one to reach at the first page i.e. user can't swipe from last page to the first. (github.com/virtualforce/Today_i_Fixed_iOS/blob/main/How%20to%20add%20infinite%20scroll%20in%20UIPageViewController.md)
@andrey_tech
2 ай бұрын
I mean it is possible to do it with UIPageViewController, but you need additional tweaks for that...
@georgelin2309
Жыл бұрын
Love it a lot! Very clear and helpful!
@andrey_tech
Жыл бұрын
Glad it was helpful!
@everyontech2716
Жыл бұрын
very good explanation
@isb09-v8y
2 ай бұрын
why do we need cache and CoreData both? Isn't CoreData sufficient for client side storage?
@andrey_tech
2 ай бұрын
DataSource cache is used for caching PhotoViewModel objects for 10 min and CoreData is used for caching raw objects that we receive from the API for as long as we need them.
@moomoocowjonny
10 ай бұрын
5:35 the size of a photo object is 100 bytes? Just curious where you got this number
@tinhhuynh2641
9 ай бұрын
I think it's size of URL string since the API doesn't return the image
@andrey_tech
9 ай бұрын
It is the size of the URL string only. Images are downloaded separately
@yevhendubinin
8 ай бұрын
Why does Presenter deal with DataSource and PhotoService deciding when to request new data, and when to use the cached one? Does not look to me as a responsibility of the Presenter. How about using either Interactor or StoriesService for that? PhotoOrderer on the other hand may be a direct dependency of the Presenter, as it basically the presentation layer part.
@PavelPalancica
7 ай бұрын
I think this is a broader issue, where engineers don't necessarily assume a 3-layer architecture (Presentation, Business Logic, and Data Acccess) to start with. M in MVC, MVVM, MVP, is often perceived as the ultimate source of truth, and code that interacts with remote or local data is seen more like Utility/Helper classes etc. that can be used from anywhere, but technically should mostly be considered part of the Model imo (if we don't follow strictly a 3-layer architecture, although physcically can be a separate folder or module). And it becomes a similar issue with MVVM when some people make view models do to much orchestration between remote and local data, as well as UI logic and data transformation (or even worse, make them directly initiate web requests, talk to Core Data etc. instead of using abstractions and not be dependent on those implementation details belonging to other layers). Both view models and presenters should be lightweight, in general. I think people also confuse what is Business Logic and UI/Presentation Logic and often mix those. Business Logic should be a layer or a module of it's own, and reflect a small part of data residing on the server (the ultimate source of truth). Some interactor in the Presentation layer would send or receive data from the Business Logic layer, and then the UI will make additional mapping and conversions if needed.
@dragonzhao433
8 ай бұрын
what's the diff between initialLoad and headLoad? why we need initialLoad if it have no data?
@dragonzhao433
8 ай бұрын
also why we need cursor for headLoad? shouldn't it just return the latest data?
@dragonzhao433
8 ай бұрын
I'm just thinking we can probably only need headLoad(pageSize) which return most recent data and tailLoad(pageSize,cursor) which return what after cursor, and periodically polling headLoad for most recent story and compare it with local stored head id to see if there's update/new story. or the other approach is to just use SSE to listen for update from server if there's new update
@alexvaiman4966
5 ай бұрын
dude stop maintaining silent push )), it is totally unrelated to what user needs, delivery time is something, undocumented, even if the app in foreground. silent pushes, is nice tool for pushing something not very important, or argent.
Пікірлер: 21