Hi
I've been asked to extend a simple legacy application by adding a few tables and classes in it to extend functionality.
This is a .Net 1.1 application which I have now successfully upgraded to .Net 3.5
Now my problem is that for these new tables and classes I wanted to add an ORM and a business logic layer that I can in the future...
Although not a pure OOD principle - should DRY also be included when thinking about SOLID principles? If not - why not?
...
I saw this code and have some questions:
public class MyClassB : MyClassA, IMyClass
{
void IMyClass.InsertUser(User user) { }
}
Why did they have to prefix the interface, IMyClass and not just do:
void InsertUser(User user) { }
or maybe do
void new InsertUser(User user)
Also, since you are inheriting from MyClassA (which i...
I write a lot of scripts in Python to analyze and plot experimental data as well as write simple simulations to test how theories fit the data. The scripts tend to be very procedural; calculate some property, calculate some other property, plot properties, analyze plot...
Rather than just writing a procedure, would there be an benefits...
I'm writing a program to do a search and export the output.
I have three primary objects:
Request
SearchResults
ExportOutput
Each of these objects links to its precursor.
Ie: ExportOutput -> SearchResults -> Request
Is this ok? Should they somehow be more loosely coupled?
Clarification:
Processes later on do use properties a...
Which design pattern should I use for a very simple Object-oriented todo list?
Initially I started off with classes for Task, TaskList, Driver. Also a simple UI displaying a list of the Task titles. I was struggling to have the UI update the list when new tasks were added, and in trying to solve this I realised my whole layout was proba...
Is it possible to create multiple instances of an object in javascript such that they all are ready to be manipulated/edited at the same time? This relates to my earlier question here: Structure of orders in restaurant. What I am trying to do is keep each order object ready for editing until the customer is ready to pay/leave so that new...
We've had a slight change to our system which means what used to be two related business rule are now the exact same rule. Because of this, I've generalised the implementation and I'm wondering what to do with the old specified classes related to them.
Is it lazy to leave the old classes lying around and just inheriting the new generali...
I'm reading through the Source Making site, specifically the Refactoring section. On the page describing the Long Method problem, the following statement is made:
Older languages carried an overhead in
subroutine calls, which deterred
people from small methods. Modern OO
languages have pretty much eliminated
that overhead for...
I'm currently designing a list widget to add to my widget engine. Since every elements visual aspects are defined outside the code I can reuse most of the code base. For instance tab buttons are actually checkboxes. New templates take time to implement since they should have at least a viewer in design application.
I already have an imp...
I'm fairly new to classical inheritance as I mainly deal with ECMAScript and Python, though I do a fair bit of ( shudder ) PHP. I know it's heavily influenced by Java and other classical inheritance based languages.
Question:
I was taking a peek at a few classes in a framework and noticed that the 'new' keyword wasn't called ( directl...
Hi, I've been using OOP in PHP for a while now, but for some reason am having a total brain meltdown and can't work out what's going wrong here!
I have a much more complex class, but wrote a simpler one to test it, and even this isn't working...
Can anyone tell me what I'm doing wrong?
class test
{
public $testvar;
function _...
Why would anyone want to mark a class as final or sealed?
...
After reading about both, I just have curiosity, how programming community uses this?
In what situation which?
...
Having learned Java and C++, I've learned the OO-way. I want to embark on a fairly ambitious project but I want to do it in C. I know how to break problems down into classes and how to turn them into class hierarchies. I know how to abstract functionality into abstract classes and interfaces. I'm even somewhat proficient at using polymor...
I have a number of COBOL programmers who are moving to .NET. I've found many struggle to adopt/understand OO programming principles. I don't have any COBOL experience, so my ability to find what few similarities there are is very limited.
There's no way I want to say "forget your twenty years of experience. This is all new," but I don...
Let's say I have this :
class whatever(object):
def __init__(self):
pass
and this function:
def create_object(type_name):
# create an object of type_name
I'd like to be able to call the create_object like this:
inst = create_object(whatever)
and get back an instance of whatever. I think this should be doable without ...
Recently I start playing with OO Perl and I've been creating quite a bunch of new objects for a new project that I'm working on. As I'm unfamilliar with any best practice regarding OO Perl and we're kind in a tight rush to get it done :P
I'm putting a lot of this kind of code into each of my function:
sub funcx{
use ObjectX; # i do...
I have an abstract "object" class that provides basic CRUD functionality along with validation, etc. Typically I would use the __autoload($name) magic function to load a class that would exist in its own file, named the same as the class I wish to lazy load. The code would look something like this, which as you can imagine becomes quit...
I've got two new-style Matlab classes - B & C, both concrete subclasses of an abstract parent, A. A is a subclass of hgsetset (handle class). I'd like to put them in an array in Matlab, and treat them both as A's. They are defined, roughly, as:
classdef A <hgsetget
methods
function foo(this)
%does some common stuff, then
...