Object-oriented design is the process of planning a system of interacting objects for the purpose of solving a software problem.
5
votes
2answers
179 views
Is it good to have an interface plenty of methods which belong to different concepts, just to preserve the Liskov's Principle?
I'm currently studying a course based on Software Design and I had a discussion in class with my professor and some classmates about a problem represented by the next scenario:
Scenario
Imagine ...
0
votes
2answers
74 views
Should a complex unifying class be doing computation?
I have a large application in Java filled with independent classes which are unified in a PlayerCharacter class. The class is intended to hold a character's data for a game called the Burning Wheel, ...
5
votes
6answers
212 views
+50
Passing an object between different handlers or a Superclass that contains most of the logic
I'm going to try to make this as concise and concrete as possible, but apologies since I can think of multiple ways to make it work. This question might also relate to handling production workflows ...
4
votes
2answers
62 views
Is it a good idea to put declaration of protocols for delegates in a private category interface?
I have a View Controller or a View that implements delegate and dataSource methods of UITableView.
These methods are not going to be used outside this class.
So is it a good idea to make the ...
0
votes
0answers
72 views
How should I structure modules in an Angular.js application?
I am fairly new to Angular.js, and one that confuses me is how to best use modules in an application. It seems to me that modules can contain any of the other common constructs in AngularJS ...
2
votes
3answers
170 views
Dependency injection and ease of use
I'm writing a handy library (we'll call it Thinger) that goes off and fetches an XML document, does some X-Path query on it and does something helpful with the result of that. (What I'm actually doing ...
2
votes
2answers
110 views
Where should I parse data obtain with a DAO
I have a DAO that brings data from a web service, that data comes in a string, in the likes of:
*NAME|John Doe *DATEOFBIRTH|1978-23-01*ID|anID123 (...)
I have a DTO that I wanna fill up with the ...
3
votes
2answers
141 views
Are there any well-known quantitative approaches to evaluate a particular design whether it satisfies or violates the SOLID design principles? [duplicate]
I designed an application framework by considering the SOLID design principles and supported by design patterns. However, I wonder if there are any automated tools or well-known approaches to evaluate ...
4
votes
2answers
421 views
Why do most java classes end with “ers”? [closed]
...Provider
...Searcher
...Resolver
...Builder
...Manager
...Importer
...Descriptor
...Helper
...Indexer
Is it a global convention to refer a thing with "..ers" or "..ors". In contrast, a "thing" ...
0
votes
0answers
47 views
DAO Design with Child Objects
If I have objects that represent a hierarchy of relationships. For example:
Person
Spouse
Spouse Contact
Spouse Address
...
2
votes
1answer
209 views
Best OOP design pattern for a sequence of operations
I am working on an application, a module of which does the following financial operations sequentially:
When a user requests for a certain amount to be transferred into her bank account:
check ...
4
votes
6answers
360 views
Should a User class only contain attributes and no methods apart from getters/setters?
I'm trying to improve my OOP code and I think my User class is becoming way too fat.
In my program a user has rights over "lists". Read, Write, Update, Delete.
So I made a User class
class User
{
...
-1
votes
4answers
257 views
Software Design and architecture from Scratch [duplicate]
I know a lot about programming syntactically. What I am unsure is about how should I go to build a software from scratch. How should be the objects be designed and how should they interact with each ...
-5
votes
1answer
130 views
Is Software coding Redundant? [closed]
Is software becoming too complex to maintain over-time? Is coding redundant? Consider object-oriented design. Why not 'manufacture' discrete ASICs with hard-wired logic (CMOS) that emulate functions ...
0
votes
1answer
38 views
Program Structure for Table Cells Representing Objects
So I have a program with "cue" objects and each have their own table cell. The thing is that the table cells have loading bars on them that represent the progress of the cues. This presents the ...
2
votes
4answers
206 views
Derived Class Method Naming
I'm having a hard time coming up with a good naming convention for methods in derived classes that serve the same purpose as the methods in the base class. For example, if both the base class, and the ...
9
votes
2answers
219 views
Using public final rather than private getters
I see most immutable POJOs written like this:
public class MyObject {
private final String foo;
private final int bar;
public MyObject(String foo, int bar) {
this.foo = foo;
...
1
vote
3answers
324 views
What is the difference between polymorphism and factory method? [closed]
Can I say that polymorphism is same as factory method?
EDIT: So basically I can say that a factory method is used to determine at run time which object is required whereas polymorphism already knows ...
1
vote
1answer
126 views
Log design approach
Logging was always a nightmare for me! Now I have to implement it again for a proxy system.
In this proxy application, some systems ask proxy system to call some other services.
What I have to log is
...
0
votes
2answers
129 views
How to design member access for an Article-type class? [duplicate]
I am doing a final project in a C++ class writing a very simple usenet-like client/server. I figure that since it's usenet-like I'll have a NewsGroup class and an Article class, I'm now working on my ...
2
votes
4answers
281 views
What should I look for when job-hunting to find a strong OOD focus?
I'm currently seeking a job. I've got a good CV, but little industry experience, and so my difficulty is that I'm not entirely certain what I'm looking for.
What I've done is a good BSc in Computer ...
0
votes
1answer
249 views
Is object-oriented conceptual thinking something you build with experience? [closed]
I know that the answer is pretty clear because you get better on everything with time and experience. But I'll tell you where I'm coming from:
A couple of months ago I decided to learn iOS ...
4
votes
2answers
810 views
Which of these OOP examples demonstrate proper OOP concepts?
I'm still trying to wrap my head around OOP. All of the following examples work, of course, but is there one (or possibly another) that best exemplifies OOP concepts?
/**
* For the following ...
1
vote
2answers
139 views
Why sequential cohesion for operations in a method is not a good idea?
I read from the seminal Code Complete book that method statements that require to be executed in order passing parameter from one to the next is a code smell and is an example of a sequential ...
2
votes
1answer
159 views
Understanding high cohesion principle for methods in object oriented design
I know the idea of strong cohesion applies to methods as much it applies to classes. Just to be clear when I say strong cohesion of a method I mean a method which does only one task and does it well. ...
4
votes
3answers
388 views
C++ vs Objective-C design principles of setters and getters
In C++ I was told that my classes shouldn't have getters and setters: Doing it wrong... blog post.
On the other hand, in Objective-C, the direct use of ivar is discouraged, because the getters allow ...
4
votes
1answer
154 views
Explanation of Object-parameter-coupling as mentioned in Code Complete book
I have been reading up on the seminal and excellent book Code Complete. It discusses about the various kinds of couplings that can happen between modules(which may be classes as well as methods):
...
4
votes
2answers
228 views
Preventing Liskov Substitution violation
I am reimplementing some component and noticed that the original version has a Liskov Substitution violation. It's not all that critical, though I'd like to get rid of it in the new implementation . ...
4
votes
3answers
390 views
Novel polymorphism - any reasons for this code?
As part of my work on a legacy C# application I've come across a novel (to me) use of an interface & concrete implementations. I can't think of any reason why you'd do the following, but I'm ...
1
vote
3answers
266 views
C# dynamics and Expando object [closed]
Under which application development scenarios C# dynamics and ExpandoObject can be used or when to consider using c# dynamics and ExpandoObject
7
votes
7answers
421 views
Is a pair of two tightly coupled classes any better than a single, larger class?
I'm rewriting somebody else's code at the minute, and I came across two classes which reference each other directly and call methods on each other. Like so (example in C#):
class A {
B otherClass;
...
3
votes
2answers
107 views
Does this situation call for well specified associations, single table inheritance, or polymorphic association?
I'm building a web-app where users can keep track of who owes whom money.
I have users and debts.
Given a user I want to be able to find out all the debts to other users, and all the loans to other ...
2
votes
2answers
348 views
Possible with PHP MVC Framework? A better solution to client 'override' of core functionality?
Background / The Problem
I need to make a (large) application with a certain set of core functionality, and certain functionality for multiple clients within it. Each client has different ...
6
votes
4answers
472 views
Design guidelines for this scenario in C#?
I have to create a validation system(I don't want to use Data Annotation or any other system) for my C# application using .Net Compact Framework, where I have an object which contains many other ...
5
votes
7answers
776 views
Should I create interfaces for data transfer objects?
Is it a good idea or a bad idea to create an interface for data transfer objects? Presuming that the object is usually mutable.
Though my example is in Java, it should be applicable to any other ...
3
votes
1answer
210 views
MVC Pattern - How to get errors from the model to the controller?
Say I have a typical MVC setup. The controller passes on some input to the model, and asks it to do something with it. But the validation of the data fails, or there is some other problem. What's the ...
2
votes
2answers
133 views
Changing __class__ in a factory?
I'm parsing a set of XML files of different kinds (these kinds are known in advance).
These are my requirements:
I want an object to represent each XML document (object-xml mapping)
I'd rather ...
3
votes
3answers
183 views
Visitor stability vs instanceof flexibility
I am writing on a GUI program which allows for the visual creation of some configuration file. I have a class hierarchy for the configuration model and I use an object tree of that hierarchy in ...
3
votes
2answers
133 views
Automated object creation from user input
I am working on a command-line application that runs simulations. It has to be heavily configurable; the user should be able to provide a very large number (100+) of parameters, some mandatory and ...
0
votes
3answers
531 views
Is function overloading in general considered Evil? [closed]
Recently I found about two new programming languages(Vala and google's GO) which don't support method or function overloading and intend on not supporting them in the future ever! The creators of ...
0
votes
1answer
67 views
terminology for upward devolution from modules to framework
Is there a word for the problem of a framework becoming married to the software modules it supports, for example adding methods to a base class that may apply only to certain subclasses or use cases? ...
1
vote
1answer
71 views
How to get a reference to a central AssetLoader in every Widget?
I'm working on a simple UI system for a game. The building blocks are Widget objects, which can contain each other. There are several sub classes of Widget, e.g. LabelWidget, ImageWidgetand ...
4
votes
1answer
162 views
Can a common interface be defined for Cartesian and Polar coordinate data?
I'm rewriting a set of file readers that a former-colleague of mine created that read raw-point data of XYZ (Cartesian) coordinates or RTZ (Polar) coordinates. Currently the data is stored directly in ...
4
votes
5answers
782 views
OO Design related questions in technical interviews
I've been attending quite a few interviews recently and have been asked by companies to answer "design a [insert model]" questions more than a few times.
Is this normal in the industry nowadays? ...
2
votes
1answer
167 views
Why does Java's Collections.unmodifiableList return a List interface instead of an UnmodifiableList interface? [duplicate]
Possible Duplicate:
Why were Java collections implemented with “optional methods” in the interface?
I was looking at the javadoc for Collections and I noticed the ...
1
vote
1answer
128 views
How to share common methods if objects have different roles?
If 2 classes have the following in common:
part of how their state is represented (both have a linear container)
multiple identical methods (identical code, not just signature)
But are not ...
2
votes
4answers
380 views
Good design pattern for a c++ wrapper around a c object
I have written an extensible c++ wrapper around a very hard to use but also very useful c library. The goal is to have the convience of c++ for allocating the object, exposing its properties, ...
1
vote
2answers
360 views
Have I understood OOP correctly?
I had originally posed this on StackOverflow. The question was closed and I was asked to post this here instead. Here is the original question I had posted there:
I have been programming using ...
8
votes
4answers
260 views
Good implementation strategies for encapsulating shared data in a software pipeline
I'm working on re-factoring certain aspects of an existing web service. The way the service APIs are implemented is by having a kind of "processing pipeline", where there are tasks that are performed ...
2
votes
2answers
203 views
Architecture Best Practice (MVC): Repository Returns Object & Object Member Accessed Directly or Repository Returns Object Member
Architecturally speaking, which is the preferable approach (and why)?
$validation_date = $users_repository->getUser($user_id)->validation_date;
Seems to violate Law of Demeter by accessing ...




