oop

why interface can not implement another interface in java?

What I mean, interface B; interface A extends B; allowed interface A implements B; not allowed I googled it and I found this -> Implements denotes defining an implementation for the methods of an interface. However interfaces have no implementation so that's not possible. http://www.coderanch.com/t/410331/java/java/interface-imple...

How to understand abstract(OO) source code?

I explored in some open source projects and found it’s quite difficult to understand the sources. Nowadays, programmers tend to use OO design which leads source very abstract. I don’t mean they are bad, instead, I think the sources are beautiful and powerful but not easy to understand. My question: Any advice or trick about how to under...

Are types and OO coupled ?

Trying to understand if types imply OO and vice versa. Questions: What exactly is a type ? Can a class in ruby be called a 'type'. In javascript, the native functions/objects like Array,String,Function ... Are they types ? Is a C struct a type ? How is it that a language can be typed even when it doesn't support OO ? For e.g. H...

Should a javascript class explicitly return something?

Hello. I've been writing some Adobe Illustrator javascripts to improve my workflow. I've been really getting to grips with OOP recently so I've been writing it using objects and I really think it helps keep my code clean and easily up-datable. However I wanted to check some best practice with you guys. I have a rectangle object which cr...

SOLID vs. YAGNI

One of the most frequent agruments I hear for not adhering to the SOLID principles in the class design is YAGNI (allthough the arguer often doesn't call it that): "It is OK that I put both feature X and feature Y into the same class. It is so simple why bother adding a new class (i.e. complexity)." "Yes, I can put all my business log...

How to design simple game "Labyrinth with robot" ?

Hello. I am new in Object Oriented Design. I am trying to write simple game where i can set labyrinth as array and add robot to this labyrinth. Robot can do simple actions: goahead(),turnRight(),turnLeft(). How to design this simple application in OOP style? Help me please ...

OO simple question... importing same library from different classes

If I build several classes and I import the same library for each class, am I going to make my project heavy ? Or is exactly the same as importing it only once ? thanks ...

Would using a virtual destructor make non-virtual functions do v-table lookups?

Just what the topic asks. Also want to know why non of the usual examples of CRTP do not mention a virtual dtor. EDIT: Guys, Please post about the CRTP prob as well, thanks. ...

Explicitly statically typed programming langagues.

Hi, I am curious. I am interested in knowing if any languages exist like C++ and Java, in that the langauge is: (a) Explicitly (ie. not by inference) statically typed, (b) Object Oriented. I am aware of D, but what others are people using? Cheers ...

Best way to manage and initialize JS objects that represent DOM elements

When creating a web page who's content will be created and destroyed dynamically by the user, what is the best way to structure and initialize both the javascript functionality and the DOM Elements? Example -- Lets say you have a todo-list who's items can be re-ordered, created, and destroyed by the user: Each Item will have a visual ...

Re-Teaching Myself to Program - Seeking Object Oriented Design Books

Five years ago I used to program in SAS. Since then I've been doing software QA of various types. Mostly manual (video games + web apps) testing with a tiny bit of automation. I'd really like to shift careers back into programming. Specifically the Android platform has caught my attention. These are the books I've been reading and worki...

Javascript OOP library for client and server-side js (node.js)

Hi, is there any Javascript OOP library to easily work with classes, inherence and the like in a more class-based way to avoid prototypical OOP that works with JS both on the client (browser) and on the server (in my case Node.js, but generally that uses javascript core functions, so that can be used no matter the interpreter)? Thanks....

Annoying SQL exception, probably due to some code done wrong

I started working on this "already started" project, and I'm having a really annoying error when trying to execute some interactions with SQL Server 2008: The server failed to resume the transaction. Desc.: One of these errors I get in this specific method call: The aspx.cs Call: busProcesso openProcess = new busProcesso(pProc...

Derive or Inject

Recently I was hacking out some code to communicate with an external web api. The web api is a set of GET/POST operations that return Xml, called in from my application via HttpWebRequest and manipulated on my side using Linq to Xml. There is are logical groupings of api methods that form multiple services. I have created classes to r...

Is there any use for a private constant, that is not static?

Is there any reason to have a private constant, that is not static? Are there any situations that you would need a non-static private const? Would it make sense if constants where static by default? I use ActionScript3 and some Java, but I think this is a broader OOP question. ...

Object generator pattern

I have a class that represents a pretty complex object. The objects can be created by many ways: incremental building, by parsing text strings in different formats and by analyzing binary files. So far my strategy was as follows: Have the constructor (__init__, in my case) initialize all the internal variables to None Supply different ...

Limiting access to a public setter to specific objects (C#)

I'm trying to create a class (in C#) that serves as an environment for my application. I'm trying to make the class dynamic, and send it as a parameter to entities in my application. The problem is, that I want to be able to change the properties of this environment class (public setters), but at the same time I want the classes that re...

ASP.NET. Is it better to pass an entire entity to a method or pass each property of this entity as parameters?

Hi, We're developing a business ASP.NET application. Is it better to pass an entire entity to a method or pass each property of this entity as parameters? What is the best practice? Case 1. Pass Customer entity to a manager - InsertCustomer(Customer cust) Case 2. Pass each property as a parameter - InsertCustomer(string name, string add...

jQuery: how to get original value of this in methods

I'm trying to have some object oriented design using JS and jQuery. I have the following construstor: function A () { this.url = "some url"; $("rrr").autocomplete({ source: function(req, add){ $.getJSON(this.url, req, function(data) {} ... } As you guessed, I can't use this.url, since jQuery redefienes this. I can't u...

creating an object/class and using it in jquery

Hi sorry if the name of my question is not correct. i am trying to create an image rotator, but i would like to be able to re-use it more than once in a page, so i am trying to create it as an object/class. I have about 5 or 6 images on a page. i would like to have each image as a rotator, displaying a new image every 2 seconds or so...