-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[*] Update interface and abstract class viewmodel #38
Conversation
…se those instance to generate User/dummyuser in getuser function [*]Modify Iuser, so this interface include abstract functions supposed to return instance of user and dummyuser,(may add more function later) [+]Add constructor for Userfactory [+]Add quickGetUser in Userfactory, using default value stored to create desired type User [*]cleaning up some Redundant code in UserFactory
# Conflicts: # src/main/java/billgates/entities/AbstractEntry.java # src/main/java/billgates/entities/Attribute.java # src/main/java/billgates/entities/DummyUser.java # src/main/java/billgates/entities/Entry.java # src/main/java/billgates/entities/User.java
[-]remove userfactor [+]todo a alterentry demo test
[?]discuss about alterdemo later
… convenience [+]add abstract class Viewmodel that all viewmodel extends for [-]remove Updatable_alter.java [*]Modify Updatable interface so it accept all Viewmodel but not only bill_viewmodel
do not need this anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a great job, especially the idea of linking all viewmodel is excellent! However, I think some functions should be named alter() or alterEntry(). Since these functions all alter the entry, maybe it would be easier to understand if they were renamed alter or alterEntry.
|
||
|
||
public interface AlterEntryOutputPort { | ||
void updateBill(AlterEntryResponseModel model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be: viod alterEntry(AlterEntryResponseModel model);
this.useCase = useCase; | ||
} | ||
|
||
public void update(int billId, QueryEntryData entry) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be: public viod alter(int billId, QueryEntryData entry) {
} | ||
|
||
@Override | ||
public void updateBill(AlterEntryResponseModel model) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be: public void alterEntry(AlterEntryResponseModel model) {
List<List<Object>> entries = model.getEntries(); | ||
// TODO: We should format the column in a more intuitive way. | ||
AlterEntryViewModel viewModel = new AlterEntryViewModel(entries); | ||
this.view.update(viewModel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same there: this.view.alter(viewModel);
List<Entry> result = this.gateway.getBillData(User.getInstance().getCurrentBillID()).getEntries() | ||
.stream().map(d -> d.toEntryBuilder().build()).toList(); | ||
System.out.println(result); // TODO remove this | ||
this.presenter.updateBill(new AlterEntryResponseModel(result.stream().map(Entry::toObjects).toList())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same there: this.presenter.alterEntry(
Also, this pull request consists of commits from others, so you may want to open another pull request. |
Do you know how to avoid this? I did not noticed there are scott's commit here. How to start a pr that only my commit? |
Creating a new branch that's up-to-date, and coding in the new branch may work? Moreover, there are two pull requests from one branch that states separate goals. It would be better to create a new branch for every single goal, and in this way, we can separate the [+] adding implementation from [*] modifying. |
I will not review this Pull Request at the moment, as it is not really urgent to be implemented. Furthermore, with Scott's Also, I believe by implementing the use cases first and completely, we can then decide on display and rendering issues later on. But, nice start! |
I reviewed the general idea of this pull request. |
make an abstract class for Viewmodel, so the update interface (and it's abstract method)can accept all viewmodel, but not only bill_update
also, sorted usecases files under the package called usecases