257 questions
1
vote
1
answer
53
views
In OOAD, how should i represent the property that the entity is shared with multiple users with different permissions?
I am developing a feature where i have an entity which represents a view. The entity holds the attributes as things what to display in view, name and other stuffs. These can be justified as attributes ...
1
vote
1
answer
65
views
Creating reusable classes for overlapping permutations/combinations of input
I got in to a design problem where I have different implementation for saving the data and processing other things for the different tools. I used a factory design for saving the data and same in ...
1
vote
1
answer
417
views
Features and Use Case Diagrams Vs Requirements and Use Cases
According to "Head First Object-Oriented Analysis and Design", Complex projects involves first finding a feature list -> drawing use case diagrams -> breaking into smaller modules ...
0
votes
1
answer
22
views
Is <MethodName>'Ext' an object oriented design pattern?
When looking at some codebases, which heavily use inheritance or implementing interfaces, I often see some implementation classes or specific methods that basically call their superclass or ...
0
votes
1
answer
113
views
Which comes first? Class, use case diagrams or dive into code using TDD?
Which comes first? Doing proper oo analysis and design and create uml digrams then TDD cycle or just dive into code using TDD cycle?
0
votes
1
answer
443
views
YAGNI vs Program to interfaces rather than concrete implementations
YAGNI (You aren't going to need it) rule says we should the minimum number of elements in our code to do the job.
But whenever I create a class it's recommended that we should first create an ...
1
vote
1
answer
767
views
How do I create class diagrams from Use Cases? [closed]
I am coming from the Embedded Systems domain with more than 3 years experience.
In my current project, at the beginning, I was only responsible for only software development and the Team consisted of ...
0
votes
1
answer
5k
views
Airline reservation System UML question - where do these methods belong? [closed]
I am preparing for Software Engineering interviews and figured out its good to get a sense of Object Oriented Design for my interviews. In all the examples of UML diagrams I looked at, I am having ...
0
votes
1
answer
3k
views
What is the "General Hierarchy Pattern" in software engineering?
I am trying to understand the "General Hierarchy Pattern" but despite my efforts it remains unclear:
Why is it used and how does it work ?
How to model it in an UML class diagram?
What are ...
2
votes
1
answer
507
views
Adapter Design Pattern with one Adaptee class inheriting the other?
I've recently came across this question and I'm just curious if my answer is correct, and if not, where I made a mistake.
My Task:
The signatures of classes A and B are incompatible. Class C is to ...
0
votes
1
answer
470
views
Java modelling class if objects have same properties but they are fundamentally different
Suppose i have to model credit card report and debit card report. Consider they both have same properties like transaction amount, date of transaction, place of transaction, transaction id and status ...
0
votes
1
answer
421
views
Remove friend class dependency in the following case
class foo
{
bar b;
someFunction()
{
b.alphaObj->someFunctionOfAlpha();
}
};
class bar
{
friend class foo;
// many more friends
private:
alpha *alphaObj;
};
How ...
-1
votes
1
answer
68
views
Template design pattern - how to "share" implementations?
Working on a project so I'll try to generalize this.
Say I have an abstract class A with an abstract method method().
There are 4 subclasses of A: B, C, D, and E, but B and C have the same exact ...
3
votes
2
answers
987
views
UML Ternary Association Implement java Code [duplicate]
ternary association is structural relationship specifies that Object of one thing connected to object of other two's
I understand this relationship but I have no idea how to implement methods that ...
2
votes
3
answers
3k
views
UML class diagram about relationship types in project management
I'm trying to draw an class diagram for my project management software
describing the following. It contains the following classes:
Project - software projects
ProjectManager - he/she who manage the ...
1
vote
2
answers
301
views
Limit the scope of a method to one other class only in oop
This is a simple scenario in a office between employee and his manager.
In actual world manager can manage many employees but for simplicity sake
in here consider the situation between one employee ...
1
vote
2
answers
150
views
implement OOP delegation that does not violate Encapsulation
this is a simple scenario about gambling.
there is a gambler and dice.
gambler can roll the dice.then dice value will change
For the above scenario i created this Class diagram
as shown in above ...
1
vote
1
answer
117
views
Can i add functions addtocart(), removefromcart(), createorder(), executeorder() to the user class?
i'm trying to build an eshop application and this is my class diagram
i have given responsibilities and functionality to my classes but it is not obvious for me how class user is going to interact ...
0
votes
0
answers
116
views
OOP association impliment in Code which does not violate Encapsulation
this is a association scenario between driver class and car class
driver can drive the car
driver can accelerate the car
driver can check is he can drive it
driver can check is available his Driving ...
1
vote
1
answer
31
views
OOAD and Cassandra. How?
I am trying to wrap my head around doing object oriented analysis and design when your canonical data source is Cassandra.
Specifically:
How do I maintain data consistency if data is duplicated among ...
1
vote
1
answer
341
views
The observer pattern is two modules or is one module?
We can say that the Observer pattern is two modules (maybe it depends on the context) ?
think: Subject is another module Observer another module (and they're related to each other. Well, we know that ...
0
votes
0
answers
53
views
Designing a generic library for calculating player turns in games
I was asked this question in an interview.
Basically, I have to create a generic library which games can to use to calculate player turns.
I came up with this soln.
The library will define a Player ...
2
votes
2
answers
128
views
Why does an object's type refer to its interface? (Design Patterns: Elements of Reusable Object-Oriented Software book)
Why does object's type refer to its interface? Why the term type is used here? In terms of C++ I am not able to understand it.
Gamma, Erich. Design Patterns: Elements of Reusable Object-Oriented
...
1
vote
1
answer
86
views
What is the reason behind overriding a method/methods of an interface in the sub interface?
What is the reason behind overriding a method/methods of an interface in the sub interface?
for example
interface I{ public void method();}
interface I2 extends I{@Override public void method();}
2
votes
1
answer
87
views
How Composition (aka association) is another means of achieving re-use?
How can an object inside another object and the first object re-use the code behind the composed object And what is mean by composed object can be determined at run-time?
class Calculator
{
...