I am new to design and learning the design principles.
It says deriving square from rectangle is a classic example of violation of Liskov's Substitution Principle.
If that's the case, what should be the correct design?
...
Hi. I tend to sucessfully write compact applications that can encapsulate many business logic in a simple and non-redundant way. I tend to create small methods, but over time I arrive to methods that have too many parameters. I know every code requires its design, but I see and antipattern in my behaviour and I am not sure which would be...
Hi,
I want to subclass some SharePoint objects, such as SPSite, SPWeb, SPList, and SPListItem. Any idea how to do it? I cannot create an instance of my derived class since I can't construct the objects with a constructor.
I usually used a container class to wrap the said objects, but I don't think it's a good solution since it doesn't ...
I'm designing a framework which users can extend.
Basically I will provide them a set of interfaces which they can implement, and my "manager" class will call their implementations like this:
abstract1 = factory.GetConcreteExtension1()
abstract2 = factory.GetConcreteExtension2()
abstract1.DoSomething(abstract2)
Where my client impleme...
Consider the following situation
file: ./include/functions/table-config.php
containing: .
.
$tablePages = 'orweb_pages';
.
.
file: ./include/classes/uri-resolve.php
containing: class URIResolve {
.
.
var $category;
.
.
function process_uri() {
...
$this->category = $tablePages;
...
}
.
.
}
file: ./settings.php
containing: .
.
req...
I'm having a bit of trouble with a C# program I'm writing and it'd be great if someone could help.
The background is this, not terribly important, but it's why I need to figure out how to do it:
I'm using a database's Web Services to retrieve information about an entry in the database. Each access to the database returns an Object with...
Here is what I am trying to do:
if (a==true)
{
dbA objectInstance = new dbA();
}
else
{
dbB objectInstance = new dbB();
}
objectInstance.Name = "New name";
I get "the name objectInstance does not exist in the current context", I assume because the def happens inside the conditional.
There must be a better pattern to do this...
Someone once mentioned to me about a project (or two), maybe written in Java, that they used in school to help teach them design patterns. It implemented a number of the design patterns but was for learning purposes only.
I know you should not try to stuff a bunch of the design patterns into a application just for the sake of using the...
I was forced into a software project at work a few years ago, and was forced to learn C# quickly. My programming background is weak (Classic ASP).
I've learned quite a bit over the years, but due to the forced nature of how I learned C#, there are a lot of basic concepts I am unclear on.
Specifically, an interface. I understand the b...
I'm very new to flash and actionscript 3. I've been reading a lot about it and this is also my first aprouch on object oriented programming.
So far, I created an application with a login button, that's all. However, I would like to know what kind of things I am doing wrong or should be doing different (or better). I am using Adobe Flex ...
I am writing Perl classes to remove redundancies from scripts and since Perl has a lot of ways to make classes I keep having trouble making the classes properly. So does anyone have a best practice example of a class?
The biggest question I have is if there should be no global variables in a module how do you use variables across sub() ...
Can I have object with the same name as class in javascript?
...
I'm having trouble understanding how to use ORM generated objects. We're using LLBLGen for mapping our database model to objects. These objects we encapsulate in another layer which represents our business model(I think).
Maybe this bit of code will explain this better.
public class Book { // The class as used in our application
pr...
I am currently learning Perl. I have Perl hash that contains references to hashes and arrays. The hashes and arrays may in turn contain references to other hashes/arrays.
I wrote a subroutine to parse the hash recursively and print them with proper indentation. Though the routine works as expected, my instructor was not convinced about...
I mean, aside from its obligating name (the Standard Template Library)...
C++ initially intended to present OOP concepts into C. That is: you could tell what a specific entity could and couldn't do (regardless of how it does it) based on its class and class hierarchy. Some compositions of abilities are more difficult to describe in this...
If one has a good understanding of the different principles that make up OOP does the book "An Introduction to Object-Oriented Programming" by Timothy Budd would still have value to read?
It's mentioned in a few texts and it sounds like a great book to read when you're starting off but what if you've got a bit of experience under your...
I'm using the ConfigParser to read the configuration information stored in a file. I'm able to read the content and use it across other modules in the project. I'm not sure if the configuration file is read every time I call config.get(parameters). How can I make sure that the configuration information is read only once and rest of the t...
Does the FILE type used through standard C functions fopen, etc. have an object-oriented interface?
I'm looking for opinions with reasoning rather than an absolute answer, as definitions of OO vary by who you ask. What are the important OO concepts it meets or doesn't meet?
In response to JustJeff's comment below, I am not asking wheth...
I have a base class, "B", which has
two constructors, one with no
paremeters and the other that
accepts one param, an integer
I have a subclass, "S", which
inherits from "B" and does not
define any constructors in it.
I create an instance of S,
attempting to pass to the
constructor an integer.
I get the error:
Error 1 Too many argume...
In the past, whenever my application needed to insert many records into a SQL 2000 db, I would call a stored procedure, once for each record. When inserting many records, I found that performance suffered, particularly when with a fat client, calling a web service to perform the database call.
Then I learned that if I passed XML data re...