PDA

View Full Version : [CLOSED] ExtNet vs X - ReSharper warning of access to a static member of a type via a derived type



anup
Sep 14, 2012, 9:13 PM
I keep forgetting to ask about this:

Throughout your examples you use X instead of ExtNet (e.g. X.IsAjaxRequest() etc), which is nice.

At work we use ReSharper. One of the things it warns about is the use of X to access static members that come from its parent class. This is the page it gives as the reason it considers this a warning:
http://confluence.jetbrains.net/display/ReSharper/Access+to+a+static+member+of+a+type+via+a+derived+ type

Although in ReSharper it is easy to turn this warning off, as part of coding conventions/standards for our company we have opted to keep it on.

I know you can also individually ignore particular things ReSharper suggests, but on UI code that would end up with ReSharper ignore comments littered throughout the code making it hard to read (thus defeating one of the purposes of X I suppose).

I know this is not really your problem; it works. But, I was just looking at the Ext.NET code for the X class. I was wondering - do you need both classes? Couldn't ExtNET just become X? I may have missed something.

Anyway, at the moment low priority for me; just curious!

Thanks!

geoffrey.mcgill
Sep 14, 2012, 9:22 PM
My preference would be to remove "ExtNet".

When the "X" alias was first implemented, we received some feedback (pushback really) to the idea/concept. We implemented "ExtNet" as another alternative.

I've never used "ExtNet", we never use "ExtNet" in any of the samples, and it rarely (if ever) does the topic come up in the forums.

I vote to remove in v2.1.

Daniil
Sep 15, 2012, 6:36 PM
Hi Geoffrey and Anup,

Some note.

Typing X in VB gives the list of builders, because it is considered as X() in VB, i.e. our extension method:

public static BuilderFactory X(this Page self)
{
return Ext.Net.X.Builder;
}

Actually, I often see ExtNet in the VB examples of the forums.

Though, I don't think it is a problem, just we will have to add a breaking change item like:


The ExtNET class has been removed. Please use the Ext.Net.X class.

Note for the VB developers.

Please use the full Ext.Net.X name instead of just X, because VB will interpret "X" as the extension method X() which returns the list of builders.

anup
Sep 27, 2012, 7:00 PM
Hi,

Just wanted to follow up whether this will definitely be removed in 2.1 or maybe later - just in case I need to update the book somewhere (don't think I will need to, but just in case...)

Thanks!

geoffrey.mcgill
Sep 29, 2012, 12:28 AM
I switched the two classes. Now ExtNet inherits from X.

Hopefully this should solve the ReSharper warning and not cause any breaking changes.

When you have a chance, please re-test your project and let us know if this is an acceptable solution.

Daniil
Oct 02, 2012, 6:38 PM
We are marking the thread closed.

If you will have any update, please feel free to post.

anup
Oct 02, 2012, 7:40 PM
Sorry for not getting round to this sooner. Had a quick look at latest code. Looks great. Many thanks.

Daniil
Oct 02, 2012, 8:05 PM
No problem! Thank you for the feedback!