Suppose i have a use case "Customer Deposits Money on Account". Where should the functionality "Deposit()" go ? Customer or Account?. What should be the design for this use case ?
Class and their responsibility analysis
62 Views Asked by aspxsushil At
1
There are 1 best solutions below
Related Questions in CLASS
- Access objects variable & method by name
- Pass variables to extended class
- Threading Segfault when reading members
- __PHP_Incomplete_Class Object even though class is included before session started
- How to declare a class with a constructior outside of a function C++
- ClassCastException: datastructures.instances.JClass cannot be cast to java.util.ArrayList
- Java: set and get methods for strings
- Allow extension of class by injection of user-made subclass, while preserving accessibility
- Efficiency penalty of initializing a struct/class within a loop
- Possible to add a new class that can be cast to an existing final class?
- introduce c++ into html
- how can Object class in ruby be an instance of it's subclass, class "Class"
- Class enumerator values cannot be passed as parameters to another class's function
- Passive Objects in C++
- open class or implicit class in java
Related Questions in RESPONSIBILITY
- In C#, what are some rules of thumb for _where_ to clone objects?
- Code design: Who's responsible for changing object data?
- Multipart application responsibility for database
- Should a view flag be updated by API or the consumer?
- Who should be responsible for calling a method?
- Data Access Layer - Designing Class where should responsibility of creating saving be
- Zoomed in page in browser
- How handle transaction in Chain Of Responsibility pattern?
- How can i set @media only screen less then 320px for indetificator?
- Which class should be responsible for starting / ending transaction in JPA?
- How to make layout for Android app intended for wearables with api under 20
- How do you name a class/method that only calls other methods?
- Whose responsibility is it to cache / memoize function results?
- Class and their responsibility analysis
- Responsibility of object creation within class
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
When a
depositaction is performed then this action records atleast thedeposit_amountanddeposit_dateon which the action was done. So, placement of this actiondepositdepends upon the following four scenarios (or relation betweencustomerandaccount):[1] An
accountcan belong to manycustomer. However, acustomercan have a singleaccount. That is, the relation is one-to-many fromaccounttocustomer. In such a case,deposit(deposit_amountanddeposit_date) action should be part ofcustomer.[2] A
customercan hold manyaccount. However, anaccountcan belong to singlecustomer. That is, the relation is one-to-many fromcustomertoaccount. In such a case,deposit(deposit_amountanddeposit_date) action should be part ofaccount.[3] Many
accountcan belong to a singlecustomer. Also, anaccountcan be hold by manycustomer. That is, the relation is many-to-many fromaccounttocustomer. In such a case, it will be better to have a separate classCDeposit{customer_id, account_id, deposit_amount, deposit_date}which will record this actiondeposit`.[4] An
accountcan belong to only onecustomer. Also acustomercan hold only oneaccount. That is, the relation is one-to-one fromaccounttocustomer. In such a case,deposit(deposit_amountanddeposit_date) action can be part of any ofaccountorcustomer.