Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:58:09+00:00 2026-06-17T06:58:09+00:00

I have a bunch of auto-generated code (coming from Ranorex GUI testing tool) that

  • 0

I have a bunch of auto-generated code (coming from Ranorex GUI testing tool) that exposes a public interface like the one below:

public partial class MessageBoxPopupAppFolder : RepoGenBaseFolder
{
  // Ranorex.Button exposes public methods like Click()
  public virtual Ranorex.Button ButtonYes
  {
    get
    {
      return _buttonyesInfo.CreateAdapter<Ranorex.Button>(true);
    }
  }
}

My problem is that I’m in the process of writing an intermediate layer that will look like the code below, and I expect the users of that code to not bypass it by directly calling the autogenerated code (that would most probably break complex business rules)

public class MyAdapter
{
  private MessageBoxPopupAppFolder _myMessageBox;

  public static void Acknowledge()
  {
    // some complex business rules
    _myMessageBox.ButtonYes.Click();
  }
}

I have though of some solutions, but none seem really satisfactory:

  • Manually (or through a script) modify auto-generated code to change visibility of Ranorex methods. That would imply a little namespace refactoring, and be difficult to maintain through code re-generation
  • Link this code into a completely separate binary and communicate with it through a really private API. Lots of work ahead
  • Implement some kind of code self-evaluation that would detect and report (as unit test failure) any “forbidden” use of that API

What could I do?

Just to clarify: I’m not concerned about keeping my middleware secret, just need to keep control over correct sequence on actual clicks.

EDIT: What I want to expose to my team members (users of my middleware) is a business-oriented API (like Acknowledge()). This is fine. What is not fine is that I can’t prevent the Ranorex raw API (Button.Click()) to come along.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:58:11+00:00Added an answer on June 17, 2026 at 6:58 am
    1. If you want to be safe, your best choice would be your first one, using script to modified the auto-generated code. Add the script into your integrated build process to ensure this get runs all the time in case the code go regenerated.

    2. Other wise you can set up FxCop rule to detect method calls that you don’t want to be used.

    3. If the team is small and they are comfortable with following a design guideline. Then this is a matter of training team not to use the API. In your code review process your team will have to look for this issue. The drawback is that this is only a preventive action, your team member can still make mistake. QA and code review will be your best friend in this case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of PHP code that is auto-generated and it puts all
I have a bunch of code in a routine that looks a bit like
I have a bunch (in thousands against different tables) of auto generated INSERT statements.
I have a bunch of functions that map to and from some codes defined
I am working on debugging some code and noticed a bunch of auto generated
week DKK id=radio2 value=75 /> I have bunch of these div entry generated by
I have a bunch of business class with autoproperties : public class A {
I have a bunch of files in a folder checked out from a repository.
I have a bunch of html files that come with my app and are
I have a bunch of strings that are dependent on static dictionaries and each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.