0
votes
1answer
64 views

Q&A system model design [closed]

Now I am trying to build a Q&A website by myself.The models below is my model design.I have some questions about this. 1、class Category: public class Category { private String name; } ...
2
votes
1answer
52 views

Design with Context, Table and Functions

Each class of my project has several inputs and outputs. Each input, the same as output, depends on it's own set of value-datatype. I need to provide a mechanism to forward data streams from one ...
0
votes
0answers
11 views

Is it acceptable for child classes to “break” parent class functionality? [migrated]

One of the devs that works with me is following the Open/Closed Principle to add functionality to a Model by extending from our framework ORM. class BaseModel extends ORM { ... } All our models ...
-1
votes
1answer
89 views

Should I use inheritance in my case? [closed]

UPDATE - I write in C#. The code is added below. I have 2 classes that should run a service when calling their Start method, but before it they should: Copy items to F folder Open S service in ...
4
votes
2answers
118 views

Strategy Design Pattern in Python

I'm reading the awesome Head First Design Patterns book. As an exercise I converted first example (or rather a subset of it) to Python. The code I got is rather too simple, i.e. there is no abstract ...
0
votes
1answer
48 views

Instance of one class to contain arbitrary number of instances of another class in Python

I'm trying to see if there is a better way to design this. I have a class Animal that is inherited by Male and Female classes (Female class has an additional attribute). I also have a class called ...
-1
votes
1answer
80 views

design classes for a JAVA swing application [closed]

I am very new in making JAVA swing applications.. My problem statement is to make a library management application,for which i designed classes as below. Please tell me whether my design of classes ...
2
votes
1answer
122 views

Have I implemented the command pattern correctly?

This is my command interface public interface IConverter { void convert(); } This is my Receiver class public class Ogg extends Audio{ private File src; private File trgt; ...
0
votes
1answer
49 views

Actionscript 3.0, good OOP?

I have been coding for some time (3 years I think), and have recently been wondering if my coding pattern is any good. Any kind of feedback is welcome: EDIT: The thing that concerns me most is that I ...
3
votes
1answer
176 views

Optimize PHP Class

I'm looking for a better way to provide configuration options and improvements in general. I'm using the constructor injection pattern to get access to the Cache and Twitter class. $callback and ...
1
vote
1answer
100 views

Factory pattern for getting xml data

i am trying to implement factory pattern for getting XML Document from server (using javax.xml.parsers.DocumentBuilder) I have the classes below for now, could you give your opinion ? Does the ...
3
votes
4answers
134 views

Refactoring a class hierarchy to remove subclasses

I have the following class inheritances hierarchy: First the abstract parent class: <?php abstract class SegmentParserAbstract{ /** @var ParserResult */ protected $_result; protected ...
5
votes
2answers
118 views

When an object has different representations… what's the OO pattern?

I've an AbstractMessage object (a hierarchy, actually). It represents a small text message and can be sent using different transport methods: HTTP, REST and a "mailer" transport. Each transport relies ...
5
votes
1answer
400 views

Basic OOP & Solution Design

I had an exercise as below for an interview. I used two design patterns: factory and decorator. I put my code at the end of it. How could I improve the solution? Basic OOD & Solution Design ...
4
votes
2answers
243 views

Validation Class - Feedback Welcome!

I have written a Validation and Form class in PHP. Validation class allow you to define the rules of each field and a error message. Form class allow you to get a error message and also allow you ...

1 2 3
15 30 50 per page