i have a credit card object and it has an associated address object which is considered as invoice address.
Code: Select all
business rules now:
adding card: add new card row and address row
editing card: update card and address rows
deleting card: delete card and address rows
view card: get card and address rowsnow i have doubts regarding implementation of model logic and currently i can think of two ways of doing it.
1. we can have two models, cardModel and Address Model. When add/edit/delete/get card is called, first cardModel does the operation called and cardModel calls the same operation in AddressModel. this means more logic is done is done in Model of MVC.
2. we can have two models, cardModel and Address Model. Now, the card model is not aware of address model and it does not anyway interact with address model.
now, for example card is edited, update method of CardModel and update method of AddressModel are called by controller logic. this means logic is implemented in Controller of MVC.
i would like to know which one is better or suggest me any better method available to implement business logic related to the card operations that include address.
Thanks to all.