Ask a Question

Can we do descriptive programming

SriniG
Contributor

RE: Can we do descriptive programming

Yes! we need to pass the property values into the function for which property you supposed to search. i just mentioned some property names for understanding purpose you can change it based on your requirement.



if you want use it as a generic function then we need to start from top level i think so! 



Thanks,

Srini.
Colin_McCrae
Community Hero

RE: Can we do descriptive programming

"if you want use it as a generic function then we need to start from top level i think so!"



No.



No you don't.



You simply pass it the object you want to search down from as a parameter. It remains generic. Simple.



If you were looking for lines in a book, would you start from the front page every time if it was possible to start from the chapter or paragraph instead?
SriniG
Contributor

RE: Can we do descriptive programming

Thank you Colin McCrae for your suggestionsJ. If you are looking for only particular lines from single book then as you said its correct but if you want search for particular lines from any book then what you will do! every time you will search as per the level/node. If it is the case, how it will be generic function!

 

May be you are thinking as per Tree Modal!

AlexKaras
Community Hero

RE: Can we do descriptive programming


(Been in a good and relaxed mood... 🙂 )



For me the situation is obvious...



> Set obj=pg.FindAllChildren(NameProperty,ValueProperty,9999999,True)

This line requests search for *all* objects that meet specified criteria starting from the specified root. I hope that it is clear that the higher the root is in the objects hierarchy the 'more generic' search is. At the same time, the higher the root is in the objects hierarchy the worse search performance is. (Just because even if you need first found object and the sought for object is found in the first branch of the objects tree, the search will not stop until it traverses all search tree.)

And the optimal balance between the performance and reusability is a matter of a good code architecture (which, unfortunately, is a rare thing nowadays... :(. And is one of the reasons I love tools by SmartBear).



Just my $0.02... Nothing to argue about 🙂


Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
SriniG
Contributor

RE: Can we do descriptive programming

Thank you Alexei Karas 🙂 
Everseeker
Contributor

Re: RE: Can we do descriptive programming

Does TestCompete support Regex in this context (or at all)?

cancel
Showing results for 
Search instead for 
Did you mean: