Hi,
It's not as though I don't understand OOP concept, and what should be done when, but sometimes I just mentally get lost in that.
What better from an example? So I needed to download a file to a temp path, I decided to get the temp path not by the normal methods of dot net, because of irrelevant reason. So I wrote my own method for ...
Hello ladies and gentlemen!
I'm new to php and zend framework and fill very uncertain about following:
For example, I have two tables:
table1: box(id, height, width, length, weight)
table2: labels(id, boxid, text, position)
labels.boxid -> box.id
(labels.boxid is a foreign_key for primary_key box.id)
I've generated two separate sta...
Every Django model has a default primary-key id created automatically. I want the model objects to have another attribute big_id which is calculated as:
big_id = id * SOME_CONSTANT
I want to access big_id as model_obj.big_id without the corresponding database table having a column called big_id.
Is this possible?
...
I have a User model that can hold 1-n UserGroup models, each of which holds data about the user's relationship with a specific group (for example, if they're the admin of the group, when they joined the group, etc.).
I'd like to provide some helper methods like isGroupUser() and isGroupAdmin() that work on the entire set of UserGroup mo...
In the project my team is currently working on, we're modifying a commercial PHP application. The app is strewn with code where a parent class checks for and works with a property that doesn't exist in the parent class, like so:
class A
{
function doSomething()
{
if (property_exists($this, 'some_property'))
{
...
I'm still trying to get a hang of Perl's OOP features. I'm confused about something, if I have a subroutine call like:
My::Package::sub_name($param1,$param2)
will this get "My::Package" sent as the first parameter? I'd tend to say no, but I'm not sure.
...
I'm trying to extend JButton with Clojure, but I ran into a problem when I try to create my own constructors. Whenever I use :constructors with :gen-class I keep getting a "ClassFormatError: Duplicate field name&signature" message when I try to instantiate my class.
I think I'm following the Clojure docs properly. Am I doing something ...
i"m new to interfaces
i have this code
example :
public class DALF
{
public class Car
{
public int AddEdit(int? CarId, string Name)
{
....
}
public DataTable Get(int? CarId)
{
.....
return CarD.Get(obj);
}
}
public class Worker
{...
Hi everyone,
I've been playing around with PDO for the last few days, I'm working on a small CMS system to teach myself OOP skills, but even though it's only a small CMS, I want it to be able to handle whatever the web can throw at it.
This is what I've come up with so far, I'm going to add connection pooling to the constructor to enab...
print_r($fanr);
results in:
HTML_QuickForm_text Object
(
[_label] => FA-Nummer
[_type] => text
[_flagFrozen] =>
[_persistantFreeze] => 1
[_attributes] => Array
(
[name] => auftragsnr
[type] => text
[value] => 123
)
[_tabOffset] => 0
[_tab] =>
[_lin...
Is there a common standard for reporting errors in your class functions?
I've seen some c functions that you pass the error string to, so that if there is an error you can see what it is in that string, You need pointers for that though.
I'm reluctant to use the return, because sometimes you do need the return for other variables.
One...
What advice/suggestions/guidance would you provide for designing a class that has upwards of 100 properties?
Background
The class describes an invoice. An invoice can have upwards of 100 attributes describing it, i.e. date, amount, code, etc...
The system we are submitting the invoice to uses each of the 100 attributes and is submitte...
Is it possible to dynamically specify a class in Perl and access a static method in that class? This does not work, but illustrates what I'd like to do:
use Test::Class1;
my $class = 'Test::Class1';
$class::static_method();
I know I can do this:
$class->static_method();
and ignore the class name passed to stat...
I'm interested in starting to properly design my software on paper before I ever start coding. What is the standard approach for this?
I'm thinking something along the lines of UML but I feel that it's a bit overkill for a one-man project.
What are some of the things professionals say is best to do when developing hobby projects?
Anti...
What is the difference between the following two declarations?
Class.method = function () { /* code */ }
Class.prototype.method = function () { /* code using this.values */ }
Is it okay to think of the first statement as a declaration of a static method, and the second statement as a declaration of an instance method?
...
Perhaps I'm just missing a basic OOP idea in PHP, but for the life of me, I can't seem to set the "$template" variable dynamically.
If I extend the Template_Controller, I can set the template name like this:
public $template = 'template_file_name';
But I can't set it dynamically like:
public $template = $this->setTemplate();
or
...
i read about small talk being completely object oriented.. is C++ also completely object oriented? if no.. then why so??
...
I have a question, here is an example
I have a Model class: Stock
public class Stock{
//some properties, stock name, stock code;
public String StockName{
get,set
}
public String StockCode{
get,set
}
}
Also I have a service class StockService, which will load the data from database and crea...
I'm starting on a project that pulls data from and writes back to a legacy system database. I've started on the domain model and am trying to improve this design over past systems, so I'd like some feedback on this one.
This example is arbitrary, so no need for specific advice there, but let's say there's a table in the database called ...
I am building a web application and have been told that using object oriented programming paradigms affects the performance of the application.
I am looking for input and recommendations about design choices that come from moving from One Giant Function to a Object-Oriented Programming Interface.
In order to be more specific: If a W...