Click here to Skip to main content
13,898,462 members

Gary H Guo - Professional Profile


    Blog RSS
Object-oriented (OO) is about "classes" not "objects". But I truly believe that "objects" deserve more our attentions. If you agree, read more on... Dynamic Object Programming (DOP), Component-Based Object Extender (CBO Extender), AOP Container and Dynamic Decorator Pattern.

Mobile development is not just another type of front end. The real challenge is actually in the back end: How to present meaningful information in time to mobile users with exponentially increased data flooding around? Here is my first mobile solution: SmartBars - Barcode Reader, Price Comparison and Coupons.

Gary lives in southeast Michigan. My first programming language is FORTRAN. For the last a few years, I have primarily focused on .NET technologies with Mobile Development as my newest interest.


For more information on Reputation please see the FAQ.


Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilverAdmin
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSitebuilder, Subeditor, Mentor, Protector, Editor, Staff, Admin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an ArticlesilversilversilversilverSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending QuestionProtector, Admin
Approve/Disapprove a pending AnswerProtector, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Approve/Disapprove a pending Forum MessageProtector, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

Actions with a green tick can be performed by this member.

GeneralGeneric Dynamic Decorator [modified] Pin
Gary H Guo21-Jul-11 4:42
memberGary H Guo21-Jul-11 4:42 
GeneralPerformance of Dynamic Decorator [modified] Pin
Gary H Guo15-Apr-11 1:29
memberGary H Guo15-Apr-11 1:29 
People seem interested in the Dynamic Decorator but concern about the performance overhead of the .NET remoting. Here, I try to clarify some mystery of the implementation of Dynamic Decorator.

First, the Dynamic Decorator does not use the runtime implementation of RealProxy. Instead, it implements its own RealProxy - ObjectProxy. Therefore, the performance overhead related to the runtime implementation of RealProxy does not apply to the ObjectProxy.

Second, let's dig into the code of the ObjectProxy to see whether the performance is a concern. In Dynamic Decorator, a transparent proxy of the target object is returned by ObjectProxyFactory.CreateProxy method. The proxy is registered by the runtime so that when it is used to call a method, the runtime intercepts the call. This mechanism allows you to add preprocessing or postprocessing functionality before or after the target method invocation by overriding the Invoke method of the RealProxy.

If you step into the code, you will see the proxy call is resolved to a call of RealProxy.PrivateInvoke. The RealProxy.PrivateInvoke calls the virtual method RealProxy.Invoke, which is overridden by the ObjectProxy.

So, the actual work is done inside the overridden Invoke method. Inside the Invoke method of ObjectProxy, the preprocessing code is executed, then, the target method, finally, the postprocessing code.

People get impression that remoting is costly due to the runtime implementation of the RealProxy, or more specifically, the runtime implementation of Invoke method. However, that is not the case for ObjectProxy. As you see in the code of Invoke of ObjectProxy, there is no costly operations like crossing app domains, crossing contexts or context switch. It is simple code for preprocessing, target method invocation and postprocessing. They are all juicy stuff not overhead.

The other area of performance overhead is the intercept mechanism itself. It is a bit blackbox how the intercept mechanism is implemented. However, the logic behind is straightforward: if it is a transparent proxy object, call the Invoke method of its RealProxy. I cannot think of any costly operations in this.

In the end, the implementation of the Dynamic Decorator is very light and thin.

modified on Monday, April 18, 2011 7:27 AM

GeneralAspects to Object vs Aspects to Class [modified] Pin
Gary H Guo12-Jan-11 10:03
memberGary H Guo12-Jan-11 10:03 
GeneralDecorator Pattern That Doesn't Need Decorator Classes Pin
Gary H Guo7-Oct-10 17:59
memberGary H Guo7-Oct-10 17:59 
GeneralNo More ContextBoundObject‚ÄŹ [modified] Pin
Gary H Guo6-Oct-10 16:36
memberGary H Guo6-Oct-10 16:36 
GeneralHistory of Dynamic Decorator [modified] Pin
Gary H Guo5-Oct-10 16:53
memberGary H Guo5-Oct-10 16:53 
GeneralPublish experience on codeproject Pin
Gary H Guo4-Oct-10 17:52
memberGary H Guo4-Oct-10 17:52 
Generaltest blog Pin
Gary H Guo4-Oct-10 3:29
memberGary H Guo4-Oct-10 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190306.1 | Last Updated 21 Mar 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid