Many questions here on SO ask about custom classes. I, on the other hand, have no idea what they're talking about. "Custom class" seems to mean the same thing I mean when I say "class".
What did I miss, back in the '80s, that keeps me from understanding?
I know that it's possible to purchase a packaged system - for Accounting, ERP, o...
I am working on a asp.net project having a three-layered implementation. DataAccess Layer is there.DataAccessContract is a layer which contains all the interfaces which classes in dataaccess layer implement.Similarly we have a business layer and a businessLayer contract.
Now when we call Data Access from Business Layer, we call
IUserDA...
In our legacy JEE application, there are loads of value object (VO) classes which typically contain only getters and setters, maybe equals() and hashCode(). These are (typically) the entities to be saved in persistence storage. (For the record, our app has no EJBs - although that might change in the future -, and we use Hibernate for pe...
I'm having an issue with building a Javascript object, and calling methods within that object using setTimeout. I've tried various workarounds, but always during the second part of my loop the scope becomes the window object rather than my custom object. Warning: I'm pretty new at javascript.
my code:
$(function() {
slide1 = Object...
I have an interface declaring 4 methods ...
I added an abstract class implementing this interface to give developers the opportunity to choose how many methods they want to implement (specially useful in case of a listener) ...
public interface Mylistener {
void actionA();
void actionB();
void actionC();
void actionD();...
I am trying to get a couple team-members on to the OOP mindset, who currently think in terms of procedural programming.
However I am having a hard time putting into terms the "why" all this is good, and "why" they should want to benefit from it.
They use a different language than I do, and I am lacking the communication skills to expla...
Background
I really like Fluent NHibernate - it's pretty great. I don't have to write those mundane CRUD-based SQL stored procedures and that's great (not that there's anything wrong with that)!
I've gone down this path a bit on an application we're working on. And now I'm sitting with a couple dozen domain objects, each with a reposit...
a class having member template function like this
template <typename t>
class complex
{
public:
complex(t r, t im);
template<typename u>
complex(const complex<u>&);
private:
//what would be the type of real and imaginary data members here.
}
i am confused about member template function, please provide an example by whi...
Hey guys
I've got a rather short question. I am using Android and I'm on the way to write a small Game in SIMPLE (The Programming-Language which is like BASIC).
Now I would like to know if SIMPLE is Object-oriented?
I wasn't able to figure this out... I just saw that a programmer has the opportunity to write multiple ".simple" files i...
So I made a mistake.
When originally writing a signature for an API, I created something like this:
public JellyBeanResult getJellyBeanReport();
Now, it turns out that I would like to re-use the more specific JellyBeanResult object because of its functionality, but it would be confusing to have other functions return a type named for...
My question is pretty simple, but I didn't find a way to implement my code the way I want it to be. So I started wondering if the code I want to implement is not good. And if it is, what's the best way to do it.
Here it goes:
class InputManager
{
SortedDictionary<ushort,Keys> inputList = new SortedDictionary<ushort,Keys>();
...
Hello,
the idea
I'm playing with a concept of modular website builder - now mostly in theory, which would containt pages / collections based on modules (either preprogrammed or done specifically when needed).
Every module with come with it's ties to DB, views/templates and core data processing, I'm thinking about factory pattern:
bas...
So let's say we want to load some XML -
var xmlURL:String = 'content.xml';
var xmlURLRequest:URLRequest = new URLRequest(xmlURL);
var xmlURLLoader:URLLoader = new URLLoader(xmlURLRequest);
xmlURLLoader.addEventListener(Event.COMPLETE, function(e:Event):void{
trace('loaded',xmlURL);
trace(XML(e.target.data));
});
If we need to know t...
When I read articles on software development, I often heard of the phrase "clean interface". People talked about clean interface for APIs, and classes.
How do you define "clean interface"? Is there any guideline for designing a system with clean interface?
...
I have an abstract base class T, from which classes A and B inherit. I now have an operation (on T) which requires a slightly different implementation in A and B, but most of the code is the same. Let me give you an example: There are two possibilities to implement something like a .Clone method:
Public MustInherit Class T
Protected...
When you build a flash piece from scratch using flash, and it's mostly AS3 and you are using all external .as class files, how do you structure your software? what type of global variable structure do you use? does your top level class always look the same? what line of code do you use to program attaching the main sub display objects to...
I got the following class structure, I got plenty of classes like C derived from B, in some of the classes I dont want by B.OnShow() but I want A.OnShow() to be executed from C Any tricks?
abstract class A
{
protected virtual void OnShow()
{
//some code
base.OnShow();
}
}
class B : A
{
protected override v...
There are some mentioned in here but not directly so Questions should be ok?
...
I know why one shouldn't do that. But is there way to explain to a layman why this is not possible. You can explain this to a layman easily : Animal animal = new Dog();. A dog is a kind of animal but a list of dogs is not a list of animals.
...
I'm working on a class which needs to be accessible via static function calls as well as object methods. One thing I have found is that I'm duplicating logic across multiple functions.
Simplified example:
class Configurable{
protected $configurations = array();
protected static $static_configurations = array();
public fu...