Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
New Rule: AvoidUnsealedUninheritedIntern alClassRule
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Scott Peterson  
View profile  
 More options Feb 4 2008, 10:02 pm
From: Scott Peterson <lunchtimem...@gmail.com>
Date: Mon, 4 Feb 2008 19:02:20 -0800 (PST)
Local: Mon, Feb 4 2008 10:02 pm
Subject: New Rule: AvoidUnsealedUninheritedInternalClassRul e
I've added a patch with a new rule to the Files section. The rule will
advise sealing internal classes which are never subclassed.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebastien Pouliot  
View profile  
 More options Feb 5 2008, 8:47 am
From: Sebastien Pouliot <sebastien.poul...@gmail.com>
Date: Tue, 5 Feb 2008 05:47:34 -0800 (PST)
Local: Tues, Feb 5 2008 8:47 am
Subject: Re: New Rule: AvoidUnsealedUninheritedInternalClassRul e
Hello Scott,

On Feb 4, 10:02 pm, Scott  Peterson <lunchtimem...@gmail.com> wrote:

> I've added a patch with a new rule to the Files section. The rule will
> advise sealing internal classes which are never subclassed.

Wow, this is a nice morning surprise :) and extra points for the unit
tests!

Even more since I had this in a TomBoy note:
   Gendarme.Rules.Performance.SealNonVisibleTypesRule

which was based on an IRC discussion I had with JB a few weeks ago...

<spouliot> jb_: should we have a rule to seal types that are internal
(well not visible) outside an assembly ?
<spouliot> of course only if no other type inherit from it inside the
assembly and, if internal, that the internals are accessible to other
assemblies
<jbe> spouliot, am not sure about your rule to seal internal types
<jbe> but yeah, the more sealed, the better
<spouliot> jbe: somehow it didn't feel totally right, that why I
asked ;-) but I was trying to figure out what problem it could cause
<jbe> I don't think there's any real problem with it
<jbe> but it could be bothering
<jbe> like `I know I'll extend this type at some point`, I don't care
<spouliot> well since it's internal it doesn't break api compatibility
so you can still change it
<spouliot> but I understand it could report a lot of stuff
<jbe> exactly
<jbe> but heh, the more rules the people could pick from, the better
<spouliot> I was enhancing the
ConstructorShouldNotCallVirtualMethodsRule yesterday night and come up
with that, since it wouldn't not report on sealed types
<spouliot> since sealed types are a bit easier to optimize, I guess it
becomes a performance rule :)

While the rule is already useful (enough to be included) the following
would make it even more interesting IMO
<quote>and, if internal, that the internals are accessible to other
assemblies</quote>

This condition, if the assembly is compiled against a runtime >= 2.0,
should not trigger the rule.

Care to add this extra check ? (I think we already have it implemented
in another rule) Also it would be nice to have a bit of documentation
including good and bad examples for the wiki.
http://www.mono-project.com/Gendarme.Rules.Performance

Thanks a lot!
Sebastien

p.s. feel free to surprise me (like this) as often as you want :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »