PureMVC
Home
About
Code
Docs
FAQ
Forums
News
Showcase
Contact
Jobs
Welcome,
Guest
. Please
login
or
register
.
May 24, 2013, 06:42:06 AM
News:
ATTENTION: Spambots must die! Humans must visit
http://contact.futurescale.com
to request forum access.
PureMVC Architects Lounge
PureMVC Manifold
Port to CSharp
Standard Version
(Moderator:
adamczak
)
NAME property of Proxies
Pages: [
1
]
« previous
next »
Author
Topic: NAME property of Proxies (Read 3105 times)
swidnikk
Courseware Beta
Jr. Member
Posts: 13
NAME property of Proxies
«
on:
November 02, 2009, 12:15:53 PM »
I've used PureMVC AS3 Multicore for sometime now and am playing around with C# port.
The Proxy pattern has a public static NAME property with a default value of "Proxy", however after creating an instance of the proxy class (or a subclass) this NAME property is left as its default value.
This means in a command when I want to retrieve a proxy, I must manage my proxy names, where as, if I'm not mistaken, in AS3, the NAME static variable is reassigned in the constructor to reflect a particular proxy instance's given name. In this way I can retrieve a proxy by Facade.RetrieveProxy( MyProxy.Name ).
Is it by design that the static NAME variable is not reassigned in the constructor?
Logged
puremvc
Global Moderator
Hero Member
Posts: 2790
Re: NAME property of Proxies
«
Reply #1 on:
November 04, 2009, 08:20:25 AM »
The NAME variable is not overwritten in the constructor in AS3. Instead it is passed to the superclass (Proxy) where it is set as the proxyName property, which the framework requests from the class by calling getProxyName();
Looking at the C# source for Proxy, I can see it uses three overloaded constructors to allow calling with:
* no arguments (constructs with NAME and no data),
* a proxy name only (constructs with supplied name and no data),
* or a proxy name and an object (constructs with supplied name and data)
This seems ok to me if NAME can be overridden in the subclass.
-=Cliff>
Logged
adamczak
Moderator
Jr. Member
Posts: 10
Re: NAME property of Proxies
«
Reply #2 on:
November 13, 2009, 02:10:25 AM »
If you actually compare the sources of the ActionScript Proxy and C# Proxy, the code for the static NAME variable and the constructors are almost exactly the same (the three constructor overload correspond to the default values allowed in the ActionScript constructor). The way to typically use a name on the proxy, is that you create a "public
new
const string NAME" on your subclass with a class specific value, and you use that NAME variable to retrieve or remove proxies. This is the same usage pattern used in the ActionScript implementation.
Andy
Logged
puremvc
Global Moderator
Hero Member
Posts: 2790
Re: NAME property of Proxies
«
Reply #3 on:
November 13, 2009, 01:10:21 PM »
Yep. And this is the way it works with AS3 as well. The NAME on the superclass is just so that if you don't pass anything something gets registered.
-=Cliff>
Logged
Pages: [
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Announcements and General Discussion
-----------------------------
=> General Discussion
=> Getting Started
=> Architecture
=> Public Demos, Tools and Applications
===> Fabrication
-----------------------------
PureMVC Manifold
-----------------------------
=> Port Authority
===> Contributor Central
===> Client Side
===> Server Side
=> Port to AS2
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to AS3
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to ColdFusion
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to C++
===> MultiCore Version
=====> Demos and Utils
=====> Bug Report
=> Port to CSharp
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Dart
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Haxe
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Java
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to JavaScript
===> Demos and Utils
===> Native JS Branch
=====> Bug Report
===> PrototypeJS Branch
=====> Bug Report
===> Objs Branch
=====> Bug Report
===> MooTools Branch
=====> Bug Report
===> ExtJS Branch
=====> Bug Report
=> Port to Objective C
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Perl
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to PHP
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Python
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Ruby
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to TypeScript
===> Standard Version
=====> Bug Report
=====> Demos and Utilities
===> MultiCore Version
=====> Bug Report
=====> Demos and Utilities
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.11
|
SMF © 2006-2007, Simple Machines LLC
Loading...
Copyright © 2006-2008 Futurescale, Inc.