[MonoDevelop] RefactoringCommands: Encapsulate Fields initial implementation

Ben Motmans ben.motmans at gmail.com
Tue Apr 24 08:56:15 EDT 2007


On 4/24/07, Miguel Ángel Pérez <mangelp at gmail.com> wrote:
> ...

Imho, there are several issues with this solution
* the BuildEncapNameForField doesn't take '_' or 'm_' prefixes into
account, plus this should probably be a language specific
implementation or allow some user preferences. (eg: allow to strip
prefixes from Hungarian notations)

* encapsulate field should be non-invasive for the entire solution,
not only the current class, so ExistsMemberWithName should not only
check the current class, but also the base class or any derived
classes, this should also check names of events

* I don't think creating a new thread for every "encapsulate fields"
command is the way to go, since this is a lot of overhead for a short
running method, you should probably use
DispatchService.BackgroundDispatch or ThreadPool.QueueWorkerItem

* there should be more options when generating a property: allow to
only create a getter or a setter and allow to override properties, for
example: when the property
public string Test { get { ... } } exists, and we encapsulate the
field "test" with get+set, it should update this property instead of
creating a property called Test1 (or at least ask the user what he/she
wants to do)

my 2 cents (though for an "official" answer, you should probably wait
until Lluis or Jeff replies)
-- Ben


More information about the Monodevelop-list mailing list