The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
3answers
82 views

Inheritance and forcing methods to be called inside another method

I've written a text parser that extracts useful information from a given text. Texts are formatted different, so there are different specialized parsers. I've designed them so that they all must ...
2
votes
2answers
108 views

Please check my improvement on John Resig's Simple JavaScript Inheritance

I've recently read this article, and I agree that the new keyword is not good practice. Thus, I've made an improvement on John Resig's Simple JavaScript Inheritance in order to use the Class.create ...
1
vote
1answer
98 views

A parent class, a singleton subclass, and a subclass uses a builder

There are three classes and an interface. The parent class is called MobileSignal. It contains info about mobile signal. E.g., CID, LAC, device ID, MCC, user location, signal strength, etc. ...
0
votes
0answers
77 views

Understanding OO JavaScript with a simple scenario

Coming from a Java kind of OOP, I miss a lot of things in JavaScript. I am working on a Node.Js project, and I would like to use an OO approach. Looking around and asking in StackOverflow I came up ...
0
votes
0answers
15 views

Implementing global extendable / overridable ajax loader

I'm currently displaying an ajax loading image whenever a jquery ajax request occurs like this: $(document).ajaxStart(function () { $(".ajaxLoadingIndicator").show(); }); ...
1
vote
1answer
49 views

Please check if these two methods for inheritance and initialization are good or bad

I am new to JavaScript. I know that many inheritance and initialization methods have been written and use some advance features like Object.create: Simple JavaScript Inheritance Why Prototypal ...
0
votes
2answers
81 views

“fake” covariance in PHP type-hinting

Here's the situation: I've got several distinct objects, each with their own responsability and (therefore) each their own dependencies. As this is code that will be implemented in 2 existing ...
3
votes
2answers
129 views

Trying to use classes in my python code. Not sure if being done correctly

The point of my code is to: Read in the observed data from the a catalog of stars (whitespace separated table). Do some unit conversions on the observed data (math stuff). Apply an interstellar ...
0
votes
1answer
56 views

A decent use-case for static property

I'm currently writing a REST-tool that connects to a third-party server (duh). They offer a fairly large (if not too large) API in a single wsdl file, as well as separate wsdl's for each specific part ...
4
votes
0answers
163 views

Cross-browser DOMTokenList object and wrapper function. Failures and improvements?

So, this is my first question here at Code Review. I have been looking for a Cross-browser solution for DOMTokenList and element.classList. I wasn't able to find much for DOMTokenList and the ...
0
votes
0answers
93 views

Javascript Nested Classes

Are there any potential issues with the following Javascript code: var BobsGarage = BobsGarage || {}; // namespace /** * BobsGarage.Car * @constructor * @returns {BobsGarage.Car} */ ...
3
votes
2answers
205 views

PHP Classes and variables

Hy all, First of all, i'm trying to learn OOP PHP, so any advise will be great ( and sorry for the bad English ). The later idea is to create some kind of MVC Framework CMS kind of thing, just to ...
2
votes
2answers
103 views

Good implementation of Equals and GetHashCode for base class

Is this a good implementation for Equals and GetHashCode for a base class in C#: public abstract class Entity<TKey> //TKey = Type of the Key { private string FullClassName; private ...
2
votes
3answers
105 views

Flaws in this Design?

I need to find the flaws in this design. So far the only ones i can think of are: No use of generics the class Concept uses a parametrized constructor, which means every sub class would need to pass ...
1
vote
2answers
103 views

My take at OOP module/prototyping JavaScript

The last month I've been reading up on how to take my JavaScript code to the next level. I am a Java programmer at heart, so it feels nice when everything is encapsulated in classes/objects, and these ...
5
votes
2answers
77 views

Least amount of HTML and CSS to create a bottom border for every section?

I am doing a redesign and have some previously existing content in HTML that is similar to <p class="testimonial-text">Bacon ipsum dolor sit amet aliquip est tail occaecat bacon ad qui short ...
2
votes
2answers
210 views

My self-study inheritance and sub-class exercise.

I'm self-studying Java and have a question about one of the end-of-chapter exercises. The chapter focus is on inheritance and the book hasn't officially introduced polymorphism so I'm trying to stay ...
-1
votes
1answer
94 views

Should I use inheritance in my case? [closed]

UPDATE - I write in C#. The code is added below. I have 2 classes that should run a service when calling their Start method, but before it they should: Copy items to F folder Open S service in ...
0
votes
1answer
51 views

Ruby on Rails Single Table Inheritance [closed]

I'm trying to set up single table inheritance in Rails. I have single table called Finances, with a type set to Income or Expense. My code is here: https://gist.github.com/caser85/5096447 Ok, I got ...
1
vote
2answers
139 views

PHP Class Inheritance / Object Instantiation / Object / Property Scope w/ Child / Parent Classes & Dependency Container Class

In PHP, I have a parent/child class and am using dependency container to load them. I am trying to use the same database connection on all of them without duplicating the object. CLARIFICATION: MY ...
2
votes
1answer
198 views

Instantiation/Inheritance Helper — Optimization / Pitfalls

For the sake of learning javascript better and getting used to the Google Chrome Extension Api, I'm currently writing a little Chrome Extension. To keep things simple and being able to make use of ...
3
votes
2answers
82 views

How would you improve this object model design to get around Covariance Issues with ObjectModel.Collection<T>?

Consider the following simple relationship. Code [DataContract(Name = "Wheel")] public class Wheel { } [DataContract(Name = "OffRoadWheel")] public class OffRoadWheel : Wheel { } ...
3
votes
3answers
237 views

Creating students and instructors

It's simple. Person is a superclass. Student and Instructor are its subclasses. The program suppose to allow user create a student or an instructor. Run package com.exercise.inheritance1; import ...