|
In PHP, is there any performance impact on using one long class with a lot of functions in it? Or is it advisable to use many small classes and call them separately when needed?
I am a newbie in OOPS and please ignore any silliness in the question. Thanks...
Started by Nirmal on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
A set ....
Very long classes with a lot of methods and properties are very difficult to understand.
Can and should put things in the same class as long they are directly related to the logicFirst, think about clean OOP design.
|
|
Let me explain, this is about displaying class source code in IDEs. I have always only one class per file. A class is declared like this in the file mod1.js:
MYGLOB.MOD1.ClassXy = function () { //constructor, do somothing } MYGLOB.MOD1.ClassXy.prototype...
Started by Sven Larson on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Utility functions The pattern also provides a nice way of having utility functions (or class-wide data) used by the class without having to make them public at all -- not on the constructor function in `memberfunc1` utility.call(this, '....
|
|
When is a function too long? is a subset of this question, I think.
What are a few good metrics for determining that a class is too long?
I'm rerevising a set of code acceptance guidelines for a project with external contractors, and realized I haven'...
Started by Dean J on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
We count responsibilities." [Chapter 10, page 136]
One class should have unit of your design (a type or a class) should be responsible for only one thing (whatever "one in use, I would consider the scope of responsibility....
Use a different measure.
|
Ask your Facebook Friends
|
When you need to have very small objects, say that contains 2 float property, and you will have millions of them that aren't gonna be "destroyed" right away, are structs a better choice or classes?
Like in xna as a library, there are point3s, etc as structs...
Started by Joan Venge on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
One not that clear how, if at ....
If you have that many of them they're likely part of a class instance (on the heap valueS" implies their storage on the heap somewhere, probably an array field of a class instance.
It's that big of a deal.
|
|
Some friends and colleagues of mine have a little running contest to find or write the longest class/variable/property/method names possible. Keep in mind, we try to be good boys and girls and keep the naming intelligible and concise, while still explaining...
Started by Zachary Yates on
, 11 posts
by 11 people.
Answer Snippets (Read the full thread at stackoverflow):
A couple of examples from the NSString class:
NSString.completePathInfoString:caseSensitive world: SetProcessWorkingSetSize
I find it's ....
Very descriptive, but sometimes miles long.
They're kings at that.
Check out Apple's documentation.
|
|
I have a method that processes thousands of items and it takes a long time.
What is the "right" way to have the method that is doing the long operation report back its progress as it does this?
For example, if I wanted to have a progress bar in my UI ...
Started by Firesteel on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Background worker class and passing messages using progress events from a different class in c# In this particular case I would be inclined to create a custom event and fire it from the long running is always updated in the main....
|
|
Warning acronym overload approaching!!! I'm doing TDD and DDD with an MVP passive view pattern and DI. I'm finding myself adding dependency after dependency to the constructor of my presenter class as I write each new test. Most are domain objects. I'...
Started by Kenneth Cochran on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If this is the case, your "Domain ....
For TDD/DI as long as you can inject the item when you need it you don't need to add it to your when it's not horribly late at night, I realize your "Domain class" is already the Introduce Parameter.
|
|
$45.99 - May not last long SanDisk Ultra 64GB Class 10 SDHC Flash Memory Card - SDSDU-064G-A11 Go to Buy.com + Free Shipping
Same price at Buydig.com
Answer Snippets (Read the full thread at dealswell):
|
|
$46.99 - May not last long SanDisk Ultra 64GB Class 10 SDHC Flash Memory Card - SDSDU-064G-A11 Go to Buy.com for $46.99 - May not last long . + Free Shipping
Answer Snippets (Read the full thread at dealswell):
|
|
The rain pounded against his window, adding a calming background noise to the low hiss of water in pipes above the drop-ceiling and the ever-present hum of CRT monitors. Pavanc sat at his desk, surrounded by pages of printouts, eyes fixed on the glowing...
Answer Snippets (Read the full thread at stackoverflow):
Provided that the containing class.
Inside or outside the same package.
Yes, a field or method defined as public can be accessed by anyone .
Yes, if that class is public too (not package protected).
|