Calling a Program Across Projects

When large application are migrated, they are usually splitted into multiple siebling projects.

So far, when we have called a controller, it was eight in our project, or in a project we referenced, and we've done that using the new syntax.

new ShowOrders().Run(); 

When we are in a project, and we want to call a controller in a siebling project we need to use a different syntax.

For example - if we're in the Northwind.Orders project and we need the ShowCustomers program from the Northwind.Customers porject to select a customer, we can't use the new syntax - since we are not referncing the Northwind.Costomers project. Instead we'll use a syntax called Create

Create<Northwind.Customers.IShowCustomers>().Run(); 

Demo

  1. In the Northwind.Orders project add a dev demo folder.
  2. Add a UIContorller called AddOrder
  3. Add a local TextColumn called CustomerId
  4. Put it on the screen.
  5. In the OnStart call the ShowCustomers controller to select a customer.

Note

You can only call programs across project that were prepared for that.

The easy way to call a program in another project, is to add a reference to it.

For example We can add in Northwind.Orders a reference to Northwind.Customers and it'll be ok.

The problems starts if then we want to call a controller from Northind.Customers to Northwind.Orders it'll create a cyrcular reference and break.

We do recommend adding the reference in most scenariosFor the rest learn how to adjust a program to be called across project see. creating-a-program-that-can-be-called-across-projects.html



Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com