MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » October 2012

Re: replicating an I-series home-grown application to a .net platform



fixed

1. It is worthwhile and here's why. The best model for accessing db in .net, especially c# is with an ORM tool like Linq to sql. Using linq to sql if foreign keys are mapped, then you can simply traverse the chain.

For instance the one to many relationship of product categories to products can be expressed in code as

myDataContext db = new myDataContext();
foreach (product myprod in db.products.Where(p=>p.name.StartsWith("Sample"))
{
Console.WriteLine("My Product Name: {0}", myprod.name);
Console.WriteLine("My Product Category Name: {0}", myprod.category.name);
}

In the last line you can see the foreign key relationship is automatically followed and referenced making code super clean. It's worthwhile.

2. Yes. We use data queues. Data queues are without a doubt the BEST way to do this. Another good way might be to use a journal receiver or trigger to push the data to the sql server but we prefer to poll and pull from the i.

And if anyone knocks you for copying data over to a sql server, just show them that code snippet and ask them if it's understandable and maintainable vs rpg ... lol

Thanks,
Mark



On 10/5/2012 10:25 AM, Stone, Joel wrote:
My company is replicating our I-series home-grown application to a .net platform for read-only. This .net app will provide customers with a typical web-based myAccount view as seen on many websites.

I have two questions for this forum:


1) For the read-only mirrored version on .net, does it make sense to have referential integrity (RI) constraints on file relationships? Either from a purist database design standpoint or from a common business rules standpoint? It seems to me that one HAS to assume that the source app has R-I that is intact, and it seems to be asking for trouble and headaches to try to enforce RI on a mirrored system that is read-only. This will require file loads and updates in a certain sequence, which could be problematic IMO.


2) Do other companies try to replicate an app onto another platform in almost real-time? It seems that it would be SOoooo much simpler to read the Iseries DB directly. Is this replication a common practice today? Or is it more suited to the 1990's?






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact