oop

Does Scheme work with Microsoft COM?

I'm new to Scheme -- the functional programming language and I like it a lot for its first-class/higher-order functions. However, my data comes from a COM source with an object-oriented API. I know Scheme and COM belong to different programming paradigms, but I'm wondering if there is any interface or a way for Scheme to connect to a C...

Is it possible to implement Separated Interface in PHP?

I recently asked a question regarding the resolution of dependencies between Unit of Work and Data Mapper classes: http://stackoverflow.com/questions/3012657/dependency-injection-and-unit-of-work-pattern - (which was answered by Gabor de Mooij - thx) In PoEAA, Martin Fowler suggests using Separated Interface to manage these dependencie...

OO Design / Patterns - Fat Model Vs Transaction Script?

Ok, 'Fat' Model and Transaction Script both solve design problems associated with where to keep business logic. I've done some research and popular thought says having all business logic encapsulated within the model is the way to go (mainly since Transaction Script can become really complex and often results in code duplication). Howeve...

Class Methods Inheritence

I was told that static methods in java didn't have Inheritance but when I try the following test package test1; public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { TB.ttt(); TB.ttt2(); } } package test1; public class TA { static publi...

Can't get a return value from a foreach loop inside a method

I have a method in C# that finds a node with name node_name in node list arg, and returns the value of found node (assuming there's only one node with such name). If no such nodes are found, it should return an empty string. public string get_nodes_value(XmlNodeList arg, string node_name) { foreach (XmlNode arg_node in arg) { ...

When I m starting to develop Java Applications What is required to do?

Possible Duplicate: Learning Java? Hi, I'm basically a Python programmer and I want to develop a java based application. What basic requirements do I need to develop? ...

What are some recommendations for books, when talking strictly about programming against the Object Model API for SharePoint 2007?

I've read quite few books regarding programming for SharePoint 2007, but in reading these books*, and referencing the online MSDN documentation there still seem to be large gaps/flaws/errors in what is documented, and how the API works. Is there any book about the SharePoint 2007 API that delves deeply into everything? I would think tha...

Binded click loses context of my Class. JS

Hi, I have this problem that I probably understand but don't know how to handle, if there is a way. I have a class simplified as this: function DrawingTable(canvas_id){ this.canvas_id = canvas_id; bind_events() function bind_events(){ $(get_canvas()).click(function(e){ var canvas = get_canvas() //works do_something_in_...

Why is it possible to have an interface without a return type in PHP?

Why is it possible to create an interface without specifying a return type? Why doesn't this make this interface unusable? This makes it more Clear: Interface run { public function getInteger(); } class MyString implements run { public function myNumber() { } public function getInteger() { retur...

Is the design notion of layers contrived?

Hi all I'm reading through Eric Evans' awesome work, Domain-Driven Design. However, I can't help feeling that the 'layers' model is contrived. To expand on that statement, it seems as if it tries to shoe-horn various concepts into a specific, neat model, that of layers talking to each other. It seems to me that the layers model is too s...

How should nested components interact with model in a GUI application?

Broad design/architecture question. If you have nested components in a GUI, what's the most common way for those components to interact with data? For example, let's say a component receives a click on one of its buttons to save data. Should the save request be delegated up that component's ancestors, with the uppermost ancestor ultimat...

Good things to know when developing a GUI architecture from scratch

What are best practices, tips, and general things to keep in mind for building an OOP GUI architecture? ...

Best practices for class-mapping with SoapClient

Using SoapClient's class mapping feature and it's pretty sweet. Unfortunately the SOAP service we're using has a bunch of read-only properties on some of the objects and will throw faults if the properties are passed back as anything but null. Need to filter out the properties before they're used in the SOAP call and am looking for adv...

property not updating in object when page is posted

Hi I have set a property in a constructor like so function __construct() { $this->count = count(@$_SESSION['filearray']); //count how many files in array } and using it in condition statements if($this->count > 10) //then do something but it appears the count isn't being updated when I use another method of injecting values into thi...

which situation abstract class i should use

Possible Duplicates: What is the purpose of abstract classes? When to use interfaces or abstract classes? When to use both? Hi , Am not worked on extream level of oops in my projects , So i have little doubts , In which situation should i use abstract method or classes , Basically i know about abstract class definition a...

Domain Model and Contracts

I am modelling a DVD Rental Store: A Client gives its clientNumber to the System. The System checks whenever the given clientNumber is valid. The Client gives the name of the DVD he wants to rent. ... ...I will later have to form an association between a new instance of Rent DVD class concept to the current Client c. My Domain Model ...

Force result for empty() test on an object

Hello ! Simple class for example: class Foo { protected $_bar; public function setBar( $value ) { $this->_bar = $value; } } And here is the question: $obj = new Foo(); var_dump( empty( $obj ) ); // true $obj->setBar( 'foobar' ); var_dump( empty( $obj ) ); // false Is it possible to change class's b...

What is an instance of a field called?

This might be an odd question, but it has actually caused me some headache. In Object oriented programming, there are accepted names for key concepts. In our model, we have classes with methods and fields. Now, going to the data world: An instance of a class is called an object. An instance of a field is called... what? A value? Isn...

Implement a finite state automaton in OOP

I am thinking about implementing a program with finite state automaton in an OOP language like Java or C++. What would you think is the best way to implement this with a manageable amount of available states, regarding to good software design? Is it good to implement for each state an own class? If yes, how to do the bridge between two...

What's the best practice for alternate solution of Multi-Inheritance in C#

Hi All, I have some classes inherit from existing Windows Controls like TextBox and DateTimePicker, ..etc I want to add custom functionalities for these classes like (Read, Alert, ...etc) these added functionalities are the same in all these classes The problem is: these classes inherited from difference parents so I can't put my adde...