I've inherited a web application which strictly uses stored procedures to do its job. I like the approach of making it impossible for frontend developers to break the database, but I've been tired of writing calls to SPs with plain SQLs and wanted to have something saner. While I've been looking for a decent ORM (for Perl in this case, b...
Never sure where to place functions like:
String PrettyPhone( String phoneNumber ) // return formatted (999) 999-9999
String EscapeInput( String inputString ) // gets rid of SQL-escapes like '
I create a Toolbox class for each application that serves as a repository for functions that don't neatly fit into another class. I've read tha...
When I do:
class MyClass {
public $copy = file_get_contents('somefile.mdown');
}
I get:
PHP Parse error: syntax error, unexpected '(', expecting ',' or ';' \
in /file.php on line 25
I'm new to classes in PHP, but not to OOP.
I can, of course, just do file_get_contents outside of the class and all is well. What's up with this?
...
How important are coupling and cohesion within a component of an application? Here, I am talking about all those classes in a component that are not published. How important is it for them to have high cohesion and low coupling?
The reason I am asking is that I used an eclipse plugin to find out the design defects for a fairly simple pr...
First, I'm using Qt at the moment. However, I want the program eventually able to run without a GUI environment, leaving the graphical aspects for configuration mainly. The program makes hefty use of Qt timers and signals/slots, partially for QtScript. So if I want to make it non-GUI operable, hopefully parts of Qt can run without a GUI ...
Hello. I'm doing a research on how the design compiler for an OOP language differs from traditional imperative languages. I'd just like some topics to send me on my way, and if you wish, you can explain them.
For eg. I found that the type table is built differently.
...
I'm building an Authentification library that's going to have around 45+ methods for dealing with user related stuff. However I've been wondering if it's actually recommendable to keep everything on a single file.
Is there a benefit on splitting my class into several subclasses and load them when needed?
I can always for example split ...
Hi,
I have a winforms app which performs actions (logging into a site and performing UI tests), but with a number of selected options such as logging in via basic auth or normal forms auth, as well as the browser type, etc.
Is the specification design pattern best suited to this? Are there any other good strategies?
Thanks
...
What is the definition of a value class and reference class in C#?
How does this differ from a value type and reference type?
I ask this question because I read this in the MCTS Self-Paced Training Kit (Exam 70-536). Chapter 1, Lesson 1, Lesson review 4 :
You need to create a simple class or
structure that contains only value
t...
I would like to be able to compare two classes derived from the same abstract class in C#. The following code illustrates my problem.
I now I could fix the code by making BaseClass non abstract and then return a new BaseClass object in ToBassClass(). But isn't there a more elegant and efficient solution?
abstract class BaseClass
{
B...
I have a number of classes that are all related conceptually, but some more-so at the details level than others. For example, these three classes have nearly identical properties (although member functions will vary):
public class RelatedA : IRelatedType
{
public string Name { get; set; }
public string Value { get; set; }
p...
I'm curious what everyone thinks. In SQL (at least in oracle) NULL translates conceptually to "I don't know the value" so NULL = NULL is false. (Maybe it actually results in a NULL which then gets cast to false or something like that...)
This makes sense to me, but in most OO languages null means "no reference" so null==null should pr...
Hi there
I have abstract class called Tenant and Customer. The tenant in this case is like owner of the application for multi tenant application model.
The relationship between these 2 class are Many to One relationship.
public abstract class Tenant
{
protected Int32 id;
protected String name;
public Int32 ID { get; set;...
This may be a foolish question.but I want to know,,,,
In my iPhone Application I have so many classes and Xib files (Like 12 to 15).Is it ok to have it like that???...
Is there any limitation for number of classes......?????.....
Does it affect the performance of the app????....
Thanks.
...
What's the difference between Association and Dependency? Aren't they both the same thing? as if class A is associated with B then Class A is dependent on B ie. there's a dependency between A and B.
...
Hello!
i have what i hope is a quick question about some code i am building out.. basically i want to compare the variables amongst two instances of a class (goldfish) to see if one is inside the territory of another. they both have territory clases which in turn use a point clase made up of an x and y data-point.
now i was curious to ...
Hi there
I'm always coding referencing an object as a single class and if I want to get the collection of that class I just used the Get() and return as a list.
public abstract class Customer
{
private Int32 customerID;
private String customerName;
public abstract List<Customer> Get();
public abstract bool Add();
publi...
Lets say I have some domain objects that will need to be serialized/packed using a custom binary format so they can be sent over sockets to external processes. My first instinct would be to create an interface that represents any object that can be packed into this binary format.
public interface IPackable
{
byte[] Pack();
}
Then...
I've seen this used a lot, especially with SimpleXML.
Is this:
$row->unixtime
simply the same as doing this???
$row[unixtime]
What is this called, why/how should it be used?
...
Hi!
In my flex application I use services a lot. I need them to update my data in the application, so call them quite often. Currently I implemented it in the following way:
1) There is a service provider (AMFLoader class)
2) And response handler (Responder class)
The code looks like this:
public function AMFLoader(url:String):void
{...