Take away from assignment-3
This is the end of 8th week, and it is not so far from not to the end of semester. For final project, we come back with React + Redux, and Epxress (All libraries and frameworks I am familiar with), so it is suppose to be easier for me to do the job. After finishing wishpool and receiving feedback from teammates from previous projects, here is what I got.
Firstly, in term of technical, I got more familiar with Angular, and feel that it has it own advantages and disadvantages compared to React. In fact, Angular is very powerful, of course if you have worked with it for a long time and proficient in using it. The learning curve of steep, it means that you may feel easy at the beginning, but when working with larger project, it will be no longer like that. Angular can do almost everything other frameworks can do, just with different ways. Let say for storing data in client site, with Redux, you have 1 store, and you will put everything you got from server to that store, and once you got a data, let say user profile, you will never need to fetch it again (util you know that your data has updated and need to fetch again).
On the other hand, in Angular, you will normally store data in each controllers, and of course, according to convention of Angular, in a controller you can not access data from another controller, except the $rootScope. The live times of these controllers is also not the live time of the app, means that when you switch to controller B from controller A, then after that you comeback to controller A, all data in A will disappear. Thus, if in A you got some api call to get data, it will be called again when you switch back to A, and this make a bad performance. This problem can be easily solved, by putting everything into $rootScope, then you never need to worry about repeating and redundant api call. However doing in this way will make your $rootScope messy and hard to manage, especially when your app need handle complicated sets of data. That is the reason why I came up with caching solution using $cacheFactory.
So basically you will use this cache service to create caches, cache and get data in separated controllers. I am using Promise here, because in the controller, I use $http to get data from server, but I will check if the data is in cache or not before I do that, so if it was put in cache before, I should return data wrapped in Promise which is similar to what $http does.
So in term of teamwork and progress, I realize that I could do better for wishpool if I started earlier and had better attitude. Everyone knows that we all have others deadlines, homework and exams of modules to deal with, but for 3216, we need to be serious.
Learning from previous mistakes in the first 3 projects, I believe that for the final project we will have much better product.