A methodology that enables a system to be modeled as a set of objects that can be controlled and manipulated in a modular manner

learn more… | top users | synonyms (3)

2
votes
1answer
484 views

Python simulation-scripts architecture

Situation: I've some scripts that simulate user-activity on desktop. Therefore I've defined a few cases (workflows) and implemented them in Python. I've also written some classes for interacting with ...
5
votes
3answers
2k views

Make use of design patterns in C? [closed]

Design patterns are useful for object oriented languages. But how can a non-object-oriented language such as C make of use them?
6
votes
6answers
630 views

Generating different combinations from a list of muscles

Suppose we have a model of a human muscular system containing the following muscles each within a specific muscle group: Arms Biceps Triceps Forearms Torso Front Abs Chest Shoulders Torso Back ...
0
votes
2answers
194 views

Implenting ActiveRecord with inheritance?

I recently converted an old application that was using XML files as the data store to use SQL instead. To avoid a lot of changes I basically created ActiveRecord style classes that inherited from the ...
1
vote
2answers
507 views

Pattern(s) about hierarchical settings overwriting

Assume that you have a hierarchy of organizational units: - Company -- Branches --- Departments ---- Teams Lets say I have some settings (for simplicity assume that they have the same properties) ...
3
votes
7answers
2k views

Inheritance using non-abstract base class

This post is based on the question http://stackoverflow.com/questions/49002/prefer-composition-over-inheritance/11758048#comment15634305_11758048. Some people said - check whether there is “is-a” ...
1
vote
1answer
133 views

How to represent association in programs [closed]

Could someone help me in implementing association in cpp. I am trying to implement a dice game where I have two classes a diegame and a dice.
0
votes
1answer
75 views

How to deal with hints/tutorial mode?

Currently I'm working on an basic application that has a 'tutorial mode'. Initially hints (bubbles with text) will be displayed above various ui elements, explaining how they work. Currently I have a ...
0
votes
2answers
278 views

Template rendering engine legitimate use of a singleton?

I wrote a standalone singleton class (scaffold) tonight that serves as a facade to a few other classes, including a template class and a view class. Templates and views are both named and instances ...
9
votes
6answers
1k views

What are the practical ways to implement the SRP?

Simply what are the practical techniques people use to check if a class violates the single responsibility principle? I know that a class should have only one reason to change, but that sentence is ...
11
votes
5answers
4k views

Is Liskov Substitution Principle incompatible with Introspection or Duck Typing?

Do I understand correctly that Liskov Substitution Principle cannot be observed in languages where objects can inspect themselves, like what is usual in duck typed languages? For example, in Ruby, if ...
1
vote
3answers
2k views

How important is it to implement a caching system in an MVC style framework?

I am writing my own PHP framework (...waits for the groans to subside) for the purpose of learning (best practices, design principals etc.) as I'm entirely self-taught and consequently there are gaps ...
0
votes
2answers
808 views

I cannot understand the application of oops How can I develop the understanding of application of oops? [closed]

I am a developer in PHP technology, I am aware of almost all the basics of OOPS, but still cannot find out the way to apply these concepts over a procedural programming. I do it in very orthodox way, ...
3
votes
3answers
2k views

Does mobile based (Android) development, benefit from Object Oriented Programming?

My development on Android is based on scientific programs and while I'm building these most of the code is in one or two long classes. When I come to deploy these programs I try to decouple everything ...
37
votes
9answers
8k views

Explanation on how “Tell, Don't Ask” is considered good OO

This blogpost was posted on Hacker News with several upvotes. Coming from C++, most of these examples seem to go against what I've been taught. Such as example #2: Bad: def check_for_overheating(...
3
votes
2answers
237 views

Are Design Patterns SuperSet of OOP or SubSet?

Initially I started learning OOP and later started grasping concepts of Design Patterns. I wonder whether it is the Design Pattern which is the SuperSet of OOP or it is the OOP itself.
7
votes
6answers
808 views

Using empty subclasses to add to the semantics of a class hierarchy?

I was wondering whether using (almost) empty derived classes to give additional semantics to a class hierarchy was a good idea (or practice) ? Because a (not so short) example is always better than a ...
4
votes
2answers
492 views

Designing a library that is easy to use: composition or inheritance

I have designed a small library for work that consists of a few exposed classes. These can basically be thought of as a server class and client class. But now that I am writing all the test cases and ...
16
votes
6answers
4k views

Use verbs with functions, nouns with classes - what about interfaces? [closed]

Ok, I understand the normal conventions of using verbs with functions and nouns with classes. What about interfaces? Is there any methodology when coming up with interface names that may not be that ...
2
votes
1answer
705 views

Abstraction Layer over ORM Generated Entities

I am learning LINQ to SQL (and planning to learn Entity Framework). Initially I used a abstraction layer to convert LINQ to SQL entities into a domain objects. Later I discovered the “Inheritance ...
4
votes
1answer
718 views

Composition vs. Inheritance [duplicate]

Here's what is given: public interface Request {} // there are 20 subclasses of Request public class CreateUserRequest implements Request { @NotEmpty public String userName; } // request ...
6
votes
5answers
1k views

PHP - Internal APIs/Libraries - What makes sense?

I've been having a discussion lately with some colleagues about the best way to approach a new project, and thought it'd be interesting to get some external thoughts thrown into the mix. Basically, ...
2
votes
2answers
652 views

Where should instantiated classes be stored?

I'm having a bit of a design dilemma here. I'm writing a library that consists of a bunch of template classes that are designed to be used as a base for creating content. For example: public class ...
5
votes
1answer
3k views

How do game programmers design their classes to reuse in AI, network and play and pass mode?

For a two player game where, your opponent could be on the network, CPU itself or near you where you would play turn by turn on the same machine. How do people design classes for re-use ? I am in a ...
10
votes
9answers
1k views

What if globals make sense?

I've got a value that many objects need. For example, a financial application with different investments as objects, and most of them need the current interest rate. I was hoping to encapsulate my "...
7
votes
2answers
5k views

What is the correct way to implement Auth/ACL in MVC?

I am looking into making a correctly laid out MVC Auth/ACL system. I think I want the authentication of a user (and the session handling) to be separate from the ACL system. (I don't know why but this ...
7
votes
3answers
1k views

Unit testing time-bound code

I'm currently working on an application that does a lot of time-bound operations. That is, based on long now = System.currentTimeMillis();, and combined with an scheduler, it will calculate periods of ...
0
votes
2answers
460 views

Object Oriented programming and modelling [closed]

I am taking a course in OOA/D this semester. I have some doubts about Object Oriented Programming. Is it true that Object Oriented programming can be done without any specific modelling like OMT? ...
35
votes
3answers
20k views

Programming SOLID Principles

Over time I could understand two parts of SOLID – the “S” and “O”. “O” – I learned Open Closed Principle with the help of Inheritance and Strategy Pattern. “S” – I learned Single Responsibility ...
9
votes
9answers
2k views

What OO Design to use ( is there a Design Pattern )?

I have two objects that represent a 'Bar/Club' ( a place where you drink/socialise). In one scenario I need the bar name, address, distance, slogon In another scenario I need the bar name, address, ...
5
votes
4answers
4k views

using static methods and classes

I know that static methods/variables are associated with the class and not the objects of the class and are useful in situations when we need to keep count of, say the number of objects of the class ...
14
votes
9answers
12k views

Use constructor or setter method?

I am working on a UI code where I have an Action class, something like this - public class MyAction extends Action { public MyAction() { setText("My Action Text"); setToolTip("My ...
52
votes
11answers
23k views

Why is it good to split a program into multiple classes? [closed]

I'm still a student in high school (entering 10th grade), and I have yet to take an actual computer course in school. Everything I've done so far is through books. Those books have taught me concepts ...
9
votes
5answers
1k views

Why is there no service-oriented language?

Edit: To avoid further confusion: I am not talking about web services and such. I am talking about structuring applications internally, it's not about how computers communicate. It's about ...
6
votes
3answers
355 views

Instantiate proper class based on some input

I'm attempting to understand how "switch as a code smell" applies when the proper code path is determined by some observable piece of data. My Webapp object sets an internal "host" object based on ...
2
votes
1answer
455 views

Books or help on OO Analysis

I have this course where we learn about the domain model, use cases, contracts and eventually leap into class diagrams and sequence diagrams to define good software classes. I just had an exam and I ...
15
votes
7answers
5k views

Difference between Pattern and Principle

What is the difference between Object Oriented Design Patterns and Principles? Are they different things? As far as I understood both of them try to achieve some common goal (e,g. flexibility). So can ...
11
votes
5answers
3k views

Benefits of classic OOP over Go-like language

I've been thinking a lot about language design and what elements would be necessary for an "ideal" programming language, and studying Google's Go has led me to question a lot of otherwise common ...
-1
votes
1answer
1k views

What is the difference between class level attributes, Class constants and singleton methods?

What the difference given they all exist 'once per class'. When should I use one over another, i.e. for what purpose? I use Ruby.
0
votes
1answer
939 views

How to access functions in extended classes efficiently?

In PHP I have classes as below class Animal { //some vars public function printname(){ echo $this->name; } } class AnimalMySql extends Animal { static public function ...
2
votes
4answers
220 views

How to store multiple requirements with OR and AND?

Well I'm working on a personal project that needs to check if a user has met certain requirements, and they come in a form of Requirement: [c1 OR c2] AND [d1 OR d2] Requirement: [c1 AND c2] OR [d1 ...
0
votes
3answers
833 views

Passing class names or objects?

I have a switch statement switch ( $id ) { case 'abc': return 'Animal'; case 'xyz': return 'Human'; //many more } I am returning ...
5
votes
2answers
899 views

Taking Object Oriented development to the next level [closed]

Can you mention some advanced OO topics or concepts that one should be aware of? I have been a developer for 2 years now and currently aiming for a certain company that requires a web developer with ...
11
votes
4answers
2k views

Is it bad practice to use an interface for categorization only?

For example: Say I have classes A, B, C. I have two interfaces, lets call them IAnimal and IDog. IDog inherits from IAnimal. A and B are IDogs, while C is not, but it is an IAnimal. The important ...
4
votes
4answers
319 views

what is the term for the class in the bottom of a class hierarchy?

You have a class hierarchy: D extends C which extends B which extends A, for example. A would be the top class, but how about D? I am looking for a short and concise way of describing the position ...
4
votes
2answers
411 views

Is this a pattern? Proxy/delegation of interface to existing concrete implementation

I occasionally write code like this when I want to replace small parts of an existing implementation: public interface IFoo { void Bar(); } public class Foo : IFoo { public void Bar() { ...
2
votes
5answers
1k views

When is an object oriented program truly object oriented?

Let me try to explain what I mean: Say, I present a list of objects and I need to get back a selected object by a user. The following are the classes I can think of right now: ListViewer Item App [...
5
votes
3answers
5k views

What is the order of diagram drawing in a design?

I'm new with OOP and UML and I have some confusion here. I'd like to know where to start, I mean, somebody comes to you and ask you to do something (involves software design of course), once you have ...
1
vote
2answers
2k views

Sharing object between 2 classes

edit: I am thinking that dependency injection is the best approach. I am struggling to wrap my head around being able to share an object between two classes. I want to be able to create only one ...
5
votes
2answers
928 views

Object oriented design importance

I started studying Object Oriented Design and Modelling using the this book by James Rumbaugh. It uses a tool called Object Modeling Technique (OMT). I have certain newbie questions. I searched the ...