Hello,
I couldn't describe the title of my question the best,I'm sorry.
Currently,I use Invoke to access the properties on my form,It works perfect,but I have a function for each property,which is quite not comfortable.
public static void EnableLogin(int enabled)
{
var form = Form.ActiveForm as FormMain;
if (for...
Hi, I was wondering if there's a language feature in Java in which methods of a superclass would be invisible for members of a subclass:
public class Subclass extends protected Superclass
or something. I'll give an example.
Here is your superclass.
public class A{
public String getA(){...}
public String getB(){...}
publ...
Hello i want to make something on classes
i want to do a super class which one is my all class is extended on it
____ database class
/
chesterx _/______ member class
\
\_____ another class
i want to call the method that is in the database class like this
$this->database->smtelse();
...
What is the precise difference between encapsulation and abstraction?
...
Take an example login() function within a class Account.
class Account {
/* Class variables */
public function login() {
if(isset($_POST['username'])
else if(isset($_SESSION['accountId']))
return $this->_sessionLogin();
else if(isset($_COOKIE['username'])
else return false;
}
...
In python is it possible to run each function inside a class?
EDIT:
What i am trying to do is call of the functions inside a class, collect their return variables and work with that.
...
Other than implementation details, are DDD aggregates similar to GoF's facade ?
...
I have a class which looks something like this:
class MyClass
{
public:
// some stuff omitted
/***
A function which, in itself, is constant and doesn't change the class
***/
void myFunction( void ) const;
private:
/***
If loaded is true, then internal resources are loaded
***/
boolean loaded;
};
Because I desig...
Basically I have an entity (called Session) which will provide many different Services. Each service can be selectively turned ON or OFF by the user (signin or signout). I am not sure what's the best design to represent this. See UML
From a programming use case perspective, the interactions with a Session instance:
Session session = ne...
I'd like to override a class method without inheriting the base class because it'd take a lot of time and modifications and, therefore, more and more tests. It's like this:
class TestClass{
public void initialMethod(){
...
}
}
And somewhere on the code, I'd like to do something like this:
public testMethod()
{
ret...
I am working with a jquery plugin that looks like this:
(function($){
var options;
$.fn.main(opts){
options = opts;
//rest of code
}
$.fn.otherFunc(){
//does something with options
}
}(jQuery));
The problem here is that if i use this plugin 5 times on the page, the options variable gets overwritten, ...
Your job is to design a Project Plan class library which supports the tracking of tasks (similar to how MS Project works). This class library has a Task object (among others).
The Task object has a EstimatedHours (Double), StartDate (DateTime), and EndDate (DateTime) properties, among others. A Task object can have one parent Task, and...
I'm just reading up on the Chain of Responsibility pattern and I'm having trouble imagining a scenario when I would prefer its use over that of decorator.
What do you think? Does CoR have a niche use?
...
All over our codebase we have this repeated pattern where there's an interface with one method. Is this a real design pattern? If so what is it and what would the benefits be?
Here are a few examples:
public interface IRunnable
{
void Run();
}
public interface IAction
{
void Perform();
}
...
In Action Script 3, you can write a class that defines a dynamic object (MovieClip and Object are two examples), this objects can be modified in run-time. What I want to know if is there some way (in run-time, of course) to know if certain object is dynamic or not.
PS: Without making something like this:
function isDynamic(object) {
...
Trying to figure out whether PHP supports features like method overloading, inheritance, and polymorphism, I found out:
it does not support method overloading
it does support inheritance
but I am unsure about polymorphism. I found this Googling the Internet:
I should note that in PHP the
polymorphism isn't quite the way it
sh...
Does following look good?
Edit: Options are general in nature, may not be exhaustive in terms of C# elements.
Single Source file can contain following:
Notes:
Files can come in pair - Editable + Generated
Single file can have only one name-space.
File: Option-1
One partial or full class per file
Zero or more enum per file
Zero or ...
I think, the following can't be done in Java. But I would be happy to learn how to implement something that resembles it.
Suppose we have a class C, that is already used in compiled code. (We can neither change that code nor the original definition of C).
Suppose further there is interesting code that could be re-used, if only C would ...
For example, why are the date helpers written like this:
time_ago_in_words(@from_time)
Instead of like this:
@from_time.time_ago_in_words
Is this a clear design error / inconsistency? Or is there some reason for this?
...
Hi, now i'm hoping the following is possible although I'm not entirely certain it is so here goes...
Below is the setup of what I'm hoping is possible (in VB.net, feel free to answer in C# and I should be able to work it out):
Public Class A
Private _name As String
Private _s As SearchA
Public Property Name() As String
...