Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Adding member functions/fields from use cases, C++

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
GennadiyKorol Posted - Jul 15 2008 : 5:40:01 PM
Hello everyone,

I just can't stop sharing ideas, as even a small chance of them being implemented is well worth it.


This one is a slight modification of existing add member functionality in VAX.


Consider the following project. We've got the Banana and Kitchen classes. Right now we're working on the Kitchen::prepareShake() function, using Banana class:



void Kitchen::prepareShake() {
   Banana banana;
   banana.peel();

   int pieces = 10;
   Knife knife;

   // peel() function is defined in Banana class, everything's OK.
   // But cutToPieces is not yet defined...
   // We're going to write this:
   vector<EatableHandle> pieces = banana.cutToPieces(knife, pieces);
}


Now we'd click over cutToPieces and pick "add declaration"
and Visual Assist X will thoughtfully add the right signature to Banana.h file (possibly with a stub):


// in Banana.h
vector<EatableHandle> cutToPieces(Knife & knife, int pieces); 


Then one could use the great "Create implementation" feature to implement the banana-cutting routine.

Being able to check output and input parameters as passed by reference and being const would also be a great feature.

Suppose now our project contains Worker class for people working in the kitchen, containing the Worker::taste(Tastable & food) function.
Now we continue working on our Kitchen::makeShake() method and do this:



void Kitchen::prepareShake() {
  // Previous code as before.... shake variable contains the prepared shake.
  // We type this:
  worker.taste(shake);

}


Now clicking over worker we can use "Add field" or existing "create declaration"
This would add a Worker worker; member to the Kitchen class. Letting VAX figure the type of worker using the methods we used on this would be of tremendous help. If it couldn't resolve the type, a pop-up might be use where user can pick the type for the new field.

Same could be used for "Add local" / "Add parameter" features, being able to specify if we want to add Worker worker as a parameter to the current function (maybe by reference, as const?) or as a local variable initialized somewhere before.


ADD: While we're at it, can we make change signature also work by context? So if the caret is over the function banana.pe[]el() VA would recognize and let use change the signature of the peel function for the banana class.


This is essentially my vision of it, the goal is to let the editor figure most of the information about the symbol on its own, essentially letting the user focus on his code logic and not the technical details.

Hope that wasn't too long...
Thanks for reading,
Gennadiy
4   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 21 2008 : 2:29:05 PM
We are considering doing this for variables as well:

case=3964
GennadiyKorol Posted - Jul 19 2008 : 1:05:07 PM
Yeah, but I also wanted to suggest that for variables/fields as well. So VAX could figure out the variable type from the way it is used.


Like if it's passed to a function, you can deduce its type from there. If a function is called on the object, deduce the type according to function (resolve ambiguity with a pop up list). Etc.
feline Posted - Jul 17 2008 : 5:48:41 PM
We are considering a feature to create a function, where VA tries to work out the return type and the parameters:

case=2451

If I understand correctly this will do what you are looking for.
GennadiyKorol Posted - Jul 16 2008 : 3:41:03 PM
Ignore the add in the previous post, I can see that the newer build recognizes symbol under caret and allows changing the signature. Greato :)

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000