|
In a word, how?
I have a view controller that creates a few custom objects. One of those objects needs to call a method back in the controller. The object looks like it wants to call a class method in the controller, which might be fine, except that class...
Started by Eric Christensen on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
For something like:
[ delegate touchesEnded:touches withEvent:event];
of course if you want the method to pass you an id to the created object, the method doesn't need to return (void) as in my example
if you want to you can write an init....
|
|
Duplicate What are Extension Methods?
Usage of Extension Methods
What Advantages of Extension Methods have you found?
So I run into the term "extension-methods" frequently, when reading about .Net and intellisensing (!) around...
What are extension-methods...
Started by Kjensen on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
You can also define extension methods for interfacesThey're static methods....
Extension methods are static method with a special syntax for the first parameter from within a extension method.
In the specified variable.
|
|
When should anonymous methods be used when defining a delegate and when should formally defined methods be used when defining a delegate ?
Started by Scott Davies on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
IMHO, I find....
But, there are no strict rules defined when to use what .
I use anonymous methods when the function that should be executed, should only be executed the function/method that has to be executed is relatively short (5 lines max.).
|
Ask your Facebook Friends
|
Duplicate of http://stackoverflow.com/questions/391483/what-is-the-difference-between-abstract-function-and-virtual-function
What is the difference between abstract methods and virtual methods in C#.
To my understanding:
Abstract Methods: Only the abstract...
Started by tush1r on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Abstract methodsAbstract methods are always....
This opposed to not virtual methods, that can not be overridden but can hide the original method is only hidden, so when I call that from my base class I get my original method.
|
|
Hi,
I found that there are two type of methods called static methods and instance methods and their differences. But still I couldnt understand the advantages of one over another.
Sometimes i feel that static methods are not 100% object oriented.
Are ...
Started by Jaywith.7 on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
If your classes implement interfaces, then the methods belonging to thoseInstance methods require passing an implicit parameter (the this reference) which make them slightly slower than static methods....
The it an instance method.
|
|
I'm building a unit testing framework for PHP and I was curious if there is a way to get a list of an objects methods which excludes the parent class's methods. So given this:
class Foo { public function doSomethingFooey() { echo 'HELLO THERE!'; } } class...
Started by Christopher W. Allen-Poole on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I'm not completely certain that this won't return parent class... .
Class_methods = get_class_methods('Bar');
From the PHP Documenation
This will not instantiate the class, and will allow you to get an array of all of the classes methods.
|
|
How are those different Method types handled in memory.
I found two different explanations to this:
Static methods are only once in memory, whereas instance methods are in memory multiple times, one for each instance to handle the references to membervariables...
Started by BeowulfOF on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The only difference is that instance methods get another first in a single location, but instance methods....
For non-virtual methods the references canBoth are in memory only once.
Decides how many times it loads a method in memory).
|
|
I have recently started to make useful use of C# extension methods. The SO examples and the documentation suggest that they are only used for instance methods (i.e. with the this keyword). It is possible to use them (or another approach) with static/class...
Started by peter.murray.rust on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
F# however does allow this, along.
You cannot create static extension methods - it's also something I've wished to be able to do!
You the creation of static extension methods, unfortunately.
|
|
Hi,
I have a SEAM app with some JPA/Hibernate entities. And I now wonder where to put my query, persistence methods.
The default choice seems to put them in a session bean layer with injected
@PersistenceContext(...) @Inject EntityManager entityManager...
Answer Snippets (Read the full thread at stackoverflow):
What we usually do:
Have beans for business objects (like "User .
To keep beans clear of persist methods.
|
|
I'm currently creating some custom helper classes, similar to ASP.NET MVC's standard HtmlHelper . When I looked at the implementation of HtmlHelper , I noticed that most/all of the HTML generating methods (such as ActionLink() , BeginForm() , TextBox(...
Started by Martin on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I agree that the methods....
And later on (5.6) about extension methods:
Do not put extension methods in the same namespace as the extended type, unless it is for adding methods to interfaces.
Intended for common programming tasks.
|