Hi Roland,
Having to copy n' paste manually is least of your worries... migrating PowerBuilder code to C# with the PowerScript Migrator is going to require significant work: 1) partitioning your business logic, 2) dealing with unsupported features, 3) adjusting for differences between C# and PowerScript, 4) performance tuning the code, 5) creating a new UI by hand (no automatic conversion of UI), etc.
With that said, even if you think very little of your PowerScript can be salvaged (or at least not worthwhile to salvage), simply migrating your DataWindow objects and embedded SQL is going to shave of lots of time and money. In our experience, almost 100% of DataWindow objects and embedded SQL can be migrated automatically to C# using the PowerScript Migrator.
You might think that just migrating these two things is a small % of your whole app, but because rewrite projects are so long and time consuming that even small % reduction is huge absolute savings! Many of our end customers tell us a rewrite costs anywhere between $1-5 million per app and ISVs tell us a rewrite costs between $5-20 million per app.
Aside from cost, the other thing you are not considering is risk... most of these rewrites have failed. Simply using the .NET DataStore object and not even converting any existing code assets still reduces the risk exponentially. Because it makes C# programing PowerBuilder-like in concepts, the PB team is experienced at rewriting the app compared to trying to code in C# against a foreign framework, such as Entity Framework, Dapper, or ADO.NET.
Just compare these two different ways of coding C# and I guess you would prefer prefer .NET DataStore over Entity Framework.
C# Dev with .NET DataStore
public IDataStore GetOrderCustomerInfo(DateTime startDate, DateTime endDate, decimal amount)
{
IDataStore dataStore = new DataStore("d_order_customer", _context);
dataStore.Retrieve(startDate, endDate, amount);
return dataStore;
}
C# Dev with Entity Framework
public IEnumerable<D_Order_Customer> GetOrderCustomerInfo(DateTime startDate, DateTime endDate, decimal amount)
{
var query = from c in _context.Set<EFCore_Customer>()
join p in _context.Set<EFCore_Person>()
on c.PersonId equals p.Businessentityid
join s in _context.Set<EFCore_SalesOrderHeader>()
on c.CustomerId equals s.CustomerId
where s.OrderDate >= startDate &&
s.OrderDate <= endDate
group s.SubTotal by new
{
p.Title,
p.Firstname,
p.Middlename,
p.Lastname,
c.ModifiedDate,
c.CustomerId
}
into g
let avg = g.Average()
where avg > amount
orderby avg
select new D_Order_Customer
{
Person_Title = g.Key.Title,
Person_Firstname = g.Key.Firstname,
Person_Middlename = g.Key.Middlename,
Person_Lastname = g.Key.Lastname,
Customer_Modifieddate = g.Key.ModifiedDate,
Customer_Customerid = g.Key.CustomerId,
Sumamt = g.Sum(),
Avgamt = avg
};
return query.ToList();
}
Best regards,
Armeen