A methodology that enables a system to be modeled as a set of objects that can be controlled and manipulated in a modular manner
0
votes
2answers
43 views
How can a collection class instantiate many objects with one database call?
I have a baseClass where I do not want public setters. I have a load($id) method that will retrieve the data for that object from the db.
I have been using static class methods like ...
0
votes
1answer
35 views
Class diagrams - do aggregated/composed classes automatically see each other?
Let's say that in the game, a player has a pet:
Player<>------Pet
Obviously player can access Pet's fields and methods, but I assume Pet does not know about the player?
I need that Pet can access ...
4
votes
4answers
217 views
Should single purpose utility app use a class
When writing a small utility app, that does just one thing, should that one thing be encapsulated in a seperate class, or just let it be part of whatever class/module is used to start the application? ...
2
votes
2answers
93 views
Help with design structure choice: Using classes or library of functions
So I have GUI Class that will call another class called ImageProcessor that contains a bunch functions that will perform image processing algorithms like edgeDetection, gaussianblur, contourfinding, ...
3
votes
2answers
158 views
Semantic coupling vs. large class
I have hardware I communicate with via TCP. This hardware accepts ~40 different commands/requests with about 20 different responses. I've created a HardwareProxy class which has a TcpClient to send ...
4
votes
2answers
173 views
If an entity is composed, is it still a god object?
I am working on a system to configure hardware. Unfortunately, there is tons of variety in the hardware, which means there's a wide variety of capabilities and configurations depending on what ...
3
votes
3answers
213 views
Make methods that do not depend on instance fields, static?
Recently I started programming in Groovy for a integration testing framework, for a Java project. I use Intellij IDEA with Groovy plug-in and I am surprised to see as a warning for all the methods ...
0
votes
0answers
35 views
Separating Db from business with Inherited classes using multiple views
I have a software that has a car model that will be used in different views (listing, ads, detail page, carousel, up sell widget,etc).
class CarModel extends DbModel{
}
I look for a "nice way" (a ...
2
votes
7answers
402 views
Is there a pattern to restrict which classes can update another class?
Say I have a class ImportantInfo with a public writable property Data. Many classes will read this property but only a few will ever set it. Basically, if you want to update Data you should really ...
1
vote
3answers
116 views
Law of Demeter in MVC regarding Controller-View communication
The scenario: Having a Controller that controls a view composed of complex subviews.
Each one of those subviews is a separated class in a separate file. For example, one of those subviews is called ...
0
votes
0answers
13 views
How to insert images using labels in NetBeans IDE, Java? [migrated]
I'm making a virtual mall using NetBeans IDE 7.3.1
I inserted images using the following steps:
Drag and drop label onto frame
Go to label properties
Click on ellipsis of 'icon' option
Import ...
0
votes
0answers
107 views
PHP OOP: Am i following right way?
I'm learning OOP (PHP).
I've realized my own CRUD Class, that performs some kind of queries SQL.
Btw, a Gasoline asked us to realize a smart, simple web-app where he can update prices of his ...
0
votes
0answers
47 views
Object inheritance and method parameters/return types - Please check my logic
I'm preparing for a test and doing practice questions, this one in particular I am unsure I did correctly:
We are given a very simple UML diagram to demonstrate inheritance: I hope this is clear, it ...
13
votes
4answers
513 views
Switch vs Polymorphism when dealing with model and view
I can't figure out a better solution to my problem. I have a view controller that presents a list of elements. Those elements are models that can be an instance of B, C, D, etc and inherit from A. So ...
2
votes
3answers
169 views
Class design for calling “the same method” on different classes from one place
Let me introduce my situation:
I have Java EE application and in one package, I want to have classes which will act primarily as cache for some data from database, for example:
class that will hold ...