Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Generate generic class?
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
  6 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
 
Paul Batum  
View profile  
 More options Dec 6 2008, 5:11 am
From: Paul Batum <paul.ba...@gmail.com>
Date: Sat, 6 Dec 2008 02:11:16 -0800 (PST)
Local: Sat, Dec 6 2008 5:11 am
Subject: Generate generic class?
Hi Eric,

A minor request. Today I wrote this code:

var classMap = new ClassMap<Artist>();

ClassMap was highlighted red because it wasn't defined. I then hit
"create in FluentNHibernate" and it created the class, but it stayed
red because the created class wasn't generic. If I choose the normal
"create class" resharper option, its smart enough to make a generic
class, but of course its created in the same file. If I then try to
use resharper to move it over to the project under test, its not put
in the right spot. So using the default resharper option is kinda
sucky, its actually worse because its easier to use your option and
then find the class it made and switch it over to generic. But of
course it would be -even nicer- if the "create in <project>" option
was smart enough to make the class generic.

I don't make a huge number of generic classes so its not causing me a
lot of pain, but I thought it might be worth making the suggestion
anyway.


 
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.
Eric Hexter  
View profile  
 More options Dec 6 2008, 9:41 am
From: "Eric Hexter" <eric.hex...@gmail.com>
Date: Sat, 6 Dec 2008 08:41:04 -0600
Local: Sat, Dec 6 2008 9:41 am
Subject: Re: [tdd-productivity-plugin] Generate generic class?

Great... I like to hear of more use cases.  I can see value in this. I will
get this on the list, of refactorings to support.


 
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.
Eric Hexter  
View profile  
 More options Dec 12 2008, 7:27 am
From: "Eric Hexter" <eric.hex...@gmail.com>
Date: Fri, 12 Dec 2008 06:27:02 -0600
Local: Fri, Dec 12 2008 7:27 am
Subject: Re: [tdd-productivity-plugin] Generate generic class?

I looked into this. and it should not be to bad to implement.  The question
is this.  How should the generic names be defined...ie  var foo = new
Bar<string,bool>();

this should generate something like this:

public class Bar<T1,T2>
{

}

Is following the T1,T2...ect approach usable?


 
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.
Paul Batum  
View profile  
 More options Dec 12 2008, 6:33 pm
From: "Paul Batum" <paul.ba...@gmail.com>
Date: Sat, 13 Dec 2008 10:33:06 +1100
Local: Fri, Dec 12 2008 6:33 pm
Subject: Re: [tdd-productivity-plugin] Re: Generate generic class?

That should be fine.

So I'm curious, will you have to develop this functionality yourself? There
isn't a way to hook into resharper's templating and get it to do it for you?
Because resharper already knows how to make a generic class, the problem is
that its not smart enough to give you different options about where you want
it put (hence the TDD productivity plugin).

I don't really know anything about resharper plugin development. I was just
curious because it sounds like you are going to have to reimplement
something that resharper can already do.

Paul Batum


 
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.
Eric Hexter  
View profile  
 More options Dec 12 2008, 11:07 pm
From: "Eric Hexter" <eric.hex...@gmail.com>
Date: Fri, 12 Dec 2008 22:07:42 -0600
Local: Fri, Dec 12 2008 11:07 pm
Subject: Re: [tdd-productivity-plugin] Re: Generate generic class?

Actually, I am not using resharper to create the class because of a "bug/ as
designed feature" in resharper of adding folders, and having the resharper
project wrapper synchronize when a new folder is added.
 I implemented the folder creation and file creation three different ways
and the two ways that allowed me to use the resharper folder live templates
had a limitation that I could not resolve.  The last and finally way ended
up leaving me have to do a large portion of the file creation logic.  It
took me over a month to come to the current implementation and I would say
it is far from my first choice as far as what type of power it gives me..
 If you ever have a chance look through the resharper code in reflector and
you will get an idea of some of the issues with the "Open API"  there are a
lot of internal sealed classes that are quite useful in there assemblies.
Sounds like a certain framework implementation i know called Asp.net.

The good news is that their api does expose the fact that then type
decleration is generic and includes the number of generic arguments that are
defined. So that portion of the api is pretty easy to work with and will be
consistent with resharpers existing functionality.


 
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.
Paul Batum  
View profile  
 More options Dec 12 2008, 11:20 pm
From: "Paul Batum" <paul.ba...@gmail.com>
Date: Sat, 13 Dec 2008 15:20:50 +1100
Local: Fri, Dec 12 2008 11:20 pm
Subject: Re: [tdd-productivity-plugin] Re: Generate generic class?
I see, thanks for satisfying my curiosity.


 
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 »