OOP: Which class should own a method? [closed]

subjective 🙂 but honestly, I’d go with the Information Expert Pattern and say something like library.lend(item, patron) The library contains the information about the items it has (perhaps in its catalog). The library lends the item to the patron (which it knows because it registers them) Not sure how your instructor sees this, but this … Read more

Shortcut for denoting or implying getters and setters in UML class diagrams

You are correct: there is no need to include the (noise of) “boilerplate” signatures of standard setters and getters in a class model. Unfortunately, UML does not define a standard notation for implying getters and setters for private attributes. So, you’d have to use your own convention. For instance, you could include a general explanation … Read more

Difference between StateChart and Activity Diagram

It might seems so, but the difference is, activity diagrams describe activities and state charts describe states. So those models are orthogonal – you might imagine there is an activity between two states (something that occurs during the transition) and you might say there is a state between two activities. This is rather a simplification, … Read more

CRUD in a use-case diagram?

Out of these, I would say #3 is actually the worst, because “CRUD” on its own is not a use case at all; you always CRUD something. Don’t confuse use case <<extend>> with class inheritance. Option #2 is not very good either, because running through a “manage user” use case does not mean you perform … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)