Questions tagged [ooad]

Object Oriented Analysis and Design - use this tag for questions related to Object Oriented programming. Also include language tags such as java where appropriate.

Programming paradigm where entities are described as objects with features and capabilities. The main advantage of this approach is the ability to reuse and extend functionality of objects.

See also: Wikipedia entry on OOAD

256 questions
2
votes
3 answers

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 project Employee - people who are engage in…
Susantha7
  • 898
  • 1
  • 20
  • 38
2
votes
2 answers

Can you write GOF Delegation code examples?

We're studying the GOF design patterns and are blocked on the first two paragraphs of delegation. We cannot agree what the code being described in the shown paragraphs would look like.
Keith
  • 363
  • 5
  • 13
2
votes
2 answers

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 Software (Addison-Wesley Professional Computing…
Sreeraj Chundayil
  • 5,548
  • 3
  • 29
  • 68
2
votes
1 answer

Will this static class break in a multi user scenario?

Say I make a static class like following with an extension method: public static class MyStaticExtensionClass { private static readonly Dictionary AlgoMgmtDict = new Dictionary(); public static…
Perpetualcoder
  • 13,501
  • 9
  • 64
  • 99
2
votes
3 answers

mapping between a classes in class diagram and entities in ER diagram?

ER diagrams represent the abstract representation of the data model, class diagrams represent the static structure and behavior of the proposed system. Main building blocks of ER diagram are entities, main building blocks of class diagram are…
2
votes
1 answer

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 { private: long double operand_1; long…
2
votes
2 answers

override virtual function - derived classes have different parameters

Let's say we have the following 2 classes class Base { public: virtual ~Base(); virtual void op(string& s1) = 0; }; class Derived1 : public Base { public: virtual void op(string& s1) override; }; so far, so good. Now, a new requirement…
2
votes
2 answers

Is Liskov Substitution Principle violated in my example?

I wonder how I should organize my two classes. One of them represents a Knife: just a simple, solid, basic one, like a kitchen knife. Another is a PocketKnife, which has the state of being opened or closed. class Knife{ public function cut() {/*…
2
votes
1 answer

Producing detail level use case diagram

Curerntly, I am documenting all the client's requirements using usecase diagrams and ofcourse I am new in design paradigm. I have a highlevel usecase diagram that contain overall system requirements. And then I have detail level usecase diagram for…
Ra Ka
  • 2,995
  • 3
  • 23
  • 31
2
votes
1 answer

"Bridging" (Connecting) methods between distant classes

Lets suppose I have Planet and Star classes and GameLogic class in the following way //Planet.java package Game; class Planet //invisible outside of package { public String getType() {return "Im a Planet";} } . //Star.java package Game; class…
jagnelo
  • 47
  • 1
  • 7
2
votes
2 answers

Uses of UML in object oriented analysis and design

this question is regarding Object Oriented Analysis and design ,UML in object oriented analysis final result is the class diagramme of system am i right? in object oriented design final result is implement the class diagramme in code am i right…
Sachithrra Dias
  • 185
  • 1
  • 2
  • 11
2
votes
4 answers

Different interpretation of internal state based on what client wants

A Model object which has some private internal state. A component of this state is exposed to the clients. But one of the clients wants a different component of the internal state to be exposed. How should this be dealt with?An example public…
2
votes
3 answers

Association between Classes and Interfaces

I have a question about modeling associations between classes and interfaces. As far as I know, an interface specifies what an object can do; without providing the state or functionality (When to use an interface instead of an abstract class and…
Pradeep
  • 299
  • 2
  • 8
  • 15
2
votes
14 answers

Inheritance and interfaces

This is somewhat of a follow-up question to this question. Suppose I have an inheritance tree as follows: Car -> Ford -> Mustang -> MustangGT Is there a benefit to defining interfaces for each of these classes? Example: ICar -> IFord -> IMustang…
Rob Sobers
  • 20,737
  • 24
  • 82
  • 111
2
votes
1 answer

What are the responsibilities of a class constructor in python?

I am currently studying some classic Object Orientation, and have read in some book (can't remember which one right now) that "The role of a constructor is to assure that new class instances are returned (by the constructor) in a valid…
heltonbiker
  • 26,657
  • 28
  • 137
  • 252