Click here to Skip to main content
Page 1 of 3
Page Size: 10 · 25 · 50


Tag filtered by:  OOP [x]
Article 11 May 2013   license: CPOL
This is an alternative for "Interfaces in C# (for beginners)".
Answer 7 May 2013   license: CPOL
1) It sounds like your object model may be wrong, which would be why "OO is broken". I would check that in the first instance.With respect to how the "problem" would be solved in C#:2) As lukeer has suggested, you could create a static method in a class, possibly a static class, related...
Answer 7 May 2013   license: CPOL
Quote:But the classes are too different to create a base class to store the function.This is not a valid objection, in my opinion.Quote:So we decided to write "FileExists" as a global function and put it intostdafx.cpp which is now our global function storage.You don't need that (albeit...
Answer 7 May 2013   license: CPOL
Quote:And how can it be solved in languages like C# or Java in which global stuff is forbidden ?You create a static class and put the static method there.So it's accessible from wherever you need it.
Question 7 May 2013   license: CPOL
Hallo all together,In our C++/MFC project we have the following structure:class A {public: bool FileExists(...);};class B {public: bool FileExists(...);};class C {public: bool FileExists(...);};//...In some classes there is the same function which...
Answer 10 Apr 2013   license: CPOL
First off, don't expose your backing fields!Either use an automatic property: public String StrSuperPatID { get; set; }or declare the backing field as privateclass dbConnect{ private String strSuperPatID; public String StrSuperPatID { get { return...
Answer 8 Apr 2013   license: CPOL
I would not list all terms, since you can find them here: http://en.wikipedia.org/wiki/List_of_object-oriented_programming_terms[^]. Click or google for more details.You can find the definition of paradigm here: http://en.wikipedia.org/wiki/Paradigm[^]. But shortly: a paradigm is a...
OOP
Answer 8 Apr 2013   license: CPOL
Have you ever use Wikipedia?http://en.wikipedia.org/wiki/Object-oriented_programming[^]http://en.wikipedia.org/wiki/Programming_paradigm[^]
OOP
Question 8 Apr 2013   license: CPOL
Can any one define the each terminology of Object-Oriented Programming and what is the difference between the Object-Oriented Programming and Object-Oriented Paradigm?
OOP
Question 7 Apr 2013   license: CPOL
I have created a class as the following it has one global variable. using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace LankaLab{ class dbConnect { public String strSuperPatID; public String...
Answer 7 Apr 2013   license: CPOL
But pal that didn't also solved my problem. I will state the question again with some more info!frmBldCuntDet class has the following variables and those use to generate a automatic patient id. Class - 01 public partial class frmFulBldCuntDet : Form ...
Answer 4 Mar 2013   license: CPOL
In your example (C++):// Create an instance of DerivedClassDerivedClass *dc = new DerivedClass();// BTW this will work as well://BaseClass *dc = new DerivedClass();// Call the method of base classdc->BaseClass::VirtualMethod();// Let' cleandelete dc;This example...
OOP
Answer 4 Mar 2013   license: CPOL
Have a look here: http://msdn.microsoft.com/en-us/library/hfw7t1ce.aspx[^]More about inheritance:http://msdn.microsoft.com/en-us/library/ms173149.aspx[^]http://msdn.microsoft.com/en-us/library/ms228387%28v=vs.80%29.aspx[^]
OOP
Question 4 Mar 2013   license: CPOL
I have following class as public abstract class BaseClass { public virtual void VirtualMethod() { Console.WriteLine("NewBaseClass:VirtualMethod"); } } public class DerivedClass : BaseClass { public override void...
OOP
Answer 14 Feb 2013   license: CPOL
It is not possible to answer your question sensibly;Your pseudo code will always return true given the info you have given.if you can add a drum kit to a cymbal, could you also add a cymbal to a cymbal, or a drum to a cymbal? Your Cymbal object seems to act both as an individual and a...
Answer 13 Feb 2013   license: CPOL
Your $drums is actually a drum set, not a collection of drums, isn't it? So should you not be adding each cymbal to that collection rather than adding cymbal to a collection of cymbals then adding that collection to the drum set?So I would have a Drum Set to which I add each drum and...
Question 13 Feb 2013   license: CPOL
Hi,I need your help. If I add the drums to the cymbals that already belong to drums then I create a circular reference. When calling getDescription() a line like this can crash a Web Server. I want to safeguard against such mistakes. My strategy would be to check during the add() method to...
Question 11 Feb 2013   license: CPOL
I am trying to bridge a mental gap between the OOP principle of Layered Architecture[^] with the way that VS.NET starts a windows forms application. After designing my initial form I double click and get this code:Public Class frmMain Private Sub frmMain_Load(sender As Object, e As...
Answer 8 Feb 2013   license: CPOL
Yes they are useful. UML is basic for OOP developers. You have to have a knowledge for how classes are interact, associates, navigate between each other. UML diagram symbols help to clarify these communications.
Question 8 Feb 2013   license: CPOL
I was rather surprised when several companies I've been interviewing with, asked me to solve a modelling question as a part of the initial written test. The questions were vague and open ended and ranged from designing a restaurant reservation system to designing a library for borrowing and...
Answer 2 Feb 2013   license: CPOL
I would say SA's approach is correct in general. However if you cannot change the object types in question because the definitions belong to someone or something else then you have a slightly different problem.In this case I would use a form of mediator object which 'pretends' to be the type...
Answer 2 Feb 2013   license: CPOL
What you say is a bright example of anti-OOP thinking. You don't need to convert from one type to another.First of all, despite of having some different properties of different customers, they have a lot in common, such as address, name, some kind of unique ID, etc. This should be put in...
Question 2 Feb 2013   license: CPOL
I'm an amateur programmer. I sell online in various forums and write my own software to help with sales processing. So say I have a SQL database that has a customer table in it called SQL.Customer. If I make a sale online I can download a feeBay.Customer object with pretty much the same info...
Article 30 Jan 2013   license: Apache
Discover a modern, solid, and powerful way of leveraging object-oriented programming on the Web and anywhere.
Answer 19 Dec 2012   license: CPOL
In you code FooParent expects a param 'a'In your line... new FooParent();...you haven't provided this param.
Answer 19 Dec 2012   license: CPOL
inheritance in javascript:if (typeof Object.create !== 'function') { Object.create = function (o) { function F() { } F.prototype = o; return new F(); };}var newObject1 = Object.create({key1:'valuekke'});var newObject2 = Object.create(newObject1);
Question 14 Dec 2012   license: CPOL
I am trying to create some objects and wrapper classes to simplify some form checking methods. I have researched the standard routine for JavaScript inheritance but I am getting a rather odd error when running my code. Here is the gist:function FooParent (a){ this.prop = a; ...
Answer 12 Dec 2012   license: CPOL
Please see my comments on persistence. If should be either Data Contract or something like that. It should be agnostic to UML. As soon as your persistence start depending on UML definitions or anything of application field, consider all your development dead. And it should be no XAML, because...
Answer 12 Dec 2012   license: CPOL
OK, I'll show some very rough sketch of UML hierarchy. Very preliminary, pseudo-code, and only for Class Diagram and top level. Perhaps you well see that you might under-estimate the task.Let's start with abstract top level of hierarchy: abstract class Element { // Name:...
Answer 9 Dec 2012   license: CPOL
Not a valid question... After you learn something and then if you've got doubt, you can certainly come here.. And as far the solution is concerned please Google your query, he is on of our best friends.. :)
Answer 9 Dec 2012   license: CPOL
You need to look at Data Contract. Please see:http://msdn.microsoft.com/en-us/library/ms733127.aspx[^].Please see my past answer where I explain it:How can I utilize XML File streamwriter and reader in my form application?[^],Creating property files...[^].—SA
Question 9 Dec 2012   license: CPOL
Hi to all. I want to learn and explore more about programming so I was thinking if somebody is willing to be my mentor to guide me along the way.Thank you in advance ^_^
Question 9 Dec 2012   license: CPOL
I am trying to create a UML Class Diagram Editor and Generator of Class Files in (PHP but open to support for other language) based on the Diagram as a school project and I am having a difficulty on designing my classes to fit with the project.for example, if I will create a class...
Answer 4 Nov 2012   license: CPOL
See for instance: "Easy command line Java compile" at Stack Overflow[^].
Answer 4 Nov 2012   license: CPOL
You should use Eclipse or Netbeans as a IDE for programming. Both are free and will guide you through development and both can also make the build for you.
Question 4 Nov 2012   license: CPOL
HiI would like to Ask a Question about compiling an OOP Java application.Below is a Class Called ComputerGame.java which holds Game Details.package OOP;public class ComputerGame{ private String Name; private String Description; private float Cost; private boolean...
Answer 15 Oct 2012   license: CPOL
This error is not because of your template class, but because of the global variable gsThreadArgs This object is visible through multiple compilation units. The one way you can solve this is by , declare it extern wherever you have included the GSALG.h Most probably this will solve...
Question 13 Oct 2012   license: CPOL
Hi,I made a template class for a linked list. List.h has the class definition and List.cpp has all the function members for inserting a node, deleting them, etc.When I compile my project (VS2010) I got the linker error "LNK1120 unresolved externals"I found that due compiler issues,...
Answer 13 Oct 2012   license: CPOL
It sounds like you have a header block define problem,although i cannot tell withoutany source code. Is all the source code in List.h encapsulated with something like#ifndef LIST_H#define LIST_H //source code here#endifUsing define macros like this will help ensure the compiler...
Article 9 Oct 2012   license: MIT
ObjectScript 0.97-vm2 is 34% faster than PHP 5.3.3, and 61% faster than JavaScript.
Answer 5 Oct 2012   license: CPOL
This statement is not true. (This a "politically correct" expression though. :-))There is no such thing as "instance overwriting the instance", actually. It's either the same instance or not. There is nothing in your code which would cause any cross-modification, and there is no static code....
Question 5 Oct 2012   license: CPOL
Hey everyone.I've question to ask.I have this class.public class Node{ public int Kova1; // Kova 1 public int Kova2; // Kova 2 public int Kova3; // Kova 3 public int ActionNo; // Yapılan İşlem public...
Question 29 Sep 2012   license: CPOL
I have a class let supposeClass Foo{ int i ; string j; float f; }now i want list of all the attributes of this class at runt time.or the implementation of this functionpublic List ReturnListOfAttributeOfClass(Foo object){}in More Generic Form...public List...
Answer 29 Sep 2012   license: CPOL
I see you need Non Public(Private members)... Try :var fields = o.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic);
Question 28 Sep 2012   license: CPOL
I'm doing an asp.net system using nHibernate for persistence.In my code I'm separating the business classes/objects from repository. I have a set of repository classes with internally use nhibernate, but this is transparent to my application.I have a need to log every CRUD operation in my...
Answer 21 Aug 2012   license: CPOL
An abstract class in C++ contains at least one pure virtual function which is a function defined as:virtual void foo() = 0;.The important part here is the "= 0" statement.If you inherit from an abstract class you'll have to provide function definitions for every inherited pure virtual...
Answer 21 Aug 2012   license: CPOL
abstract class is base class for define other classes ex: team is developing graphics application and team is designing Line and Circle class but it is necessary both class have method with the conman name in this case team lead define an abstract class name Graphics and ask developer to derive...
Answer 21 Aug 2012   license: CPOL
Abstract classes are mainly used for specify interfaces (interface is a basic OOP concept, make sure to grasp it).You transform a concrete class into an abstract one simply adding to it a pure virtual method (or changing an existing method to pure virtual), e.g.// 'Concrete' Fooclass...
Answer 21 Aug 2012   license: CPOL
Answer to your first question:-19,000,000 results for when to use an abstract classNow, why do you require to make a concrete class abstract? As:- http://www.brpreiss.com/books/opus4/html/page611.htmlI hope this will clear out your confusion.Thanks

Page 1 of 3
1 2 3


Advertise | Privacy | Mobile
Web04 | 2.6.130513.1 | Last Updated 14 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid