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
3
votes
3 answers

Dispose the singleton object in .NET

I have two classes ClassA and ClassB both having a reference to a singleton object ClassHelper. My question is how should i dispose the singleton object once im done using both the ClassA and ClassB Edit: public ClassA { CHelper obj; public…
3
votes
1 answer

Object Oriented design evalution

I have found the following paragraph in Applying UML and pattern Now, I am wondering if there is options to evaluate the Object oriented Design? Note:I use UML (Unified Modeling Language) for Object Oriented Design Please, suggest any resources…
user2019510
  • 1,460
  • 5
  • 16
  • 29
3
votes
8 answers

OO Design question

I have a two types of products - Discounted (10% Disc) and NonDiscounted (0%) Each of these can be either LocalProduct / ExportableProduct with export one attracting a 15% sales tax. What is the best way to model this scenario. Me being absolute…
3
votes
3 answers

Encapsulate Use Cases in a software

I usually write use cases for all the software that I develop. For each use case I generally write a controller which directs the flow (implements a use case). I have recently started developing web apps using Asp.net MVC. One of the best practices…
Hemanshu Bhojak
  • 16,972
  • 16
  • 49
  • 64
3
votes
1 answer

Clarification and Example about using UML semantic variation points

As I read through UML specification 2.5(still Beta) Some tools may use the different Images for different purposes: the icon replacing the box, fo r the reduced-size icon inside the box, for icons within tree browsers, etc. Alternatively, depending…
user2019510
  • 1,460
  • 5
  • 16
  • 29
3
votes
1 answer

Does Reflection violate LSP?

From Liskov Substitution Principle - www.blackwasp.co.uk One common indication of non-compliance with the LSP is when a client class checks the type of its dependencies. This may be by reading a property of an object that artificially describes its…
LCJ
  • 22,196
  • 67
  • 260
  • 418
3
votes
1 answer

Object oriented design pattern query

i went through different questions on SO and was trying to find out what is the best way to design an application .I found that somewhere it was written that we should make the object of the class if it has a state this. i found on the same page…
Anil Sharma
  • 558
  • 6
  • 18
3
votes
3 answers

Building a structure/object in a place other than the constructor

I have different types of objects representing the same business entity. UIObject, PowershellObject, DevCodeModelObject, WMIObject all are different representation to the same entity. So say if the entity is Animal then I have AnimalUIObject,…
Vishal Naidu
  • 341
  • 2
  • 6
3
votes
2 answers

Composite of Commands Design Pattern

Does anyone have a good example in Ruby of using a Composite of Commands? It is a design pattern hybrid that I have seen mentioned in various Design Patterns literature which sounds quite powerful, but have not been able to find any interesting use…
Eric Steen
  • 719
  • 2
  • 8
  • 19
2
votes
2 answers

Program Flow via Custom Exception

I have a process that is parsing an XML file. This is occuring in the PAckage Class. The Package class has a Delegate that sets the object to an invalid state and captures the detailed info on error that occured the Package Class For simplicity I…
HoopSnake
  • 716
  • 1
  • 5
  • 17
2
votes
3 answers

How do I make instances of different child classes have the same instance of their common parent class?

Problem statement: A learning environment contains both students and staffs who have attributes in common because they are both people. In some institutions a student may also be working as a staff there at the same time. The implications of the…
Joe
  • 41
  • 5
2
votes
3 answers

How to Show Reference type and Object type separately for same object in UML object and sequence diagram

The diagram shows sample Class diagram and usage of objects of those classes in Sequence diagram. In the above diagram instance myCar can be referred either by reference of ShowroomItem or reference of interface Vehicle. Accordingly the clients…
2
votes
3 answers

Choose class methods when there is OOP delegation

This is a simple scenario for understanding this problem about persons and their house. Person can change color of their House I created this UML diagram: As shown in above diagram: A Person can change their house color. To show that, I use…
Susantha7
  • 898
  • 1
  • 20
  • 38
2
votes
4 answers

How to write data of type A to format of type B

I'm implementing a thing that generates results and writes them to a file of certain format. Fairly simple, but I want this to be dynamic. I'll throw down a few classes. Data - base class for all results DataFile - base class for all file format…
0xbaadf00d
  • 2,535
  • 2
  • 24
  • 46
2
votes
2 answers

when use one object as a field(association) vs method parameter(dependancy) as inside of another object

In an UML class diagram, an association is a stronger relationship than a dependency, association and dependency can be implemented as follows: Association --> A has-a B object (as a member variable) public class A { private B b; A(B b){ …
Susantha7
  • 898
  • 1
  • 20
  • 38