Moving old desktop application to a robust platform [closed]

Several years ago I wrote a desktop application, a small accounting system, in Delphi 7, that is in user in a medium-sized company.
The code belongs to me. I ported another Accounting system that I had built years before (Delphi/IB), to use SQL Server and added new business rules, in my free time, then I gave the application to the company. (No contracts, no license, simply the code is mine, no one is arguing that).

It currently works by connecting directly to the database. Each user in the application is a user in the database. I have roles defined for each form the user is able to see, and also they matches DB roles in SQL Server, so, not even by mistake you would be able to see data you shouldn’t be.
I also managed to mangle the passwords so that the user (a normal user, not a hacker) won’t ever be able to connect directly to the DB even if it knows the ip/port of the server.
It has worked in this way for years.

A new IT management, lots of new people, are frown upon my application.
Take note that this company also use SAP for many of the branches and my accounting system servers the purpose of a sort of a consolidation system.
They don’t like the Client/Server architecture and are pointing fingers to security risk and what not. I agree my C/S architecture and the way I connect to the database doesn’t feel robust.

I suppose I need “something” in the middle. But researching for 3-tier application I’m drowned in a sea of articles about 3-tier in the same application, I mean, just a separation of data within the same application, while I think what I need is a 2nd layer of software between my desktop app and the database. I guess I would need an application server too, may be?

I’m also fluent in C# and lately I have written more desktop apps in C# then in Delphi, so I could migrate my Delphi code to C# if needed. Since the code is mine, this is sort of an investment, I might capitalize in the future. That’s why, besides the request from IT, I’m also interested in making this more robust.

I’m looking for an article to get me started in order to write such piece of software.
WCF, Midas, ORM?

Without wanting to look pretentious, I’m looking forward to create a robust platform, like that used in SAP-ERP. So I could grow the application adding new modules, like controlling, payroll, billing, etc and turn it into a some sort of small ERP.

10

Sorry, but this is madness. Rewriting a working application in a different language because someone doesn’t like the style of data access plumbing?! It’s needless expense, effort, disruption, and risk. Where’s the ROI? What is the time-to-value? If the question describes the full reasoning, standard go/no-go business metrics cannot possibly support rip-and-replace.

This isn’t because I disagree. Direct-to-the-database connections have some real downsides, such as limited scalability, and likely violation of the least-privilege security approach. They lock data interpretation into client apps, making multi-platform apps, long version tails, and combination tasks such as data analytics more challenging. And Delphi 7 is getting a little long in the tooth. Etc. etc.

If you were a commercial software company, needed to greatly increase the number of concurrent users, needed to operate with less trusty users or on less secure networks, or had a specific feature need that direct-to-database connections impeded or precluded, I’d be the first to concur with “update your architecture” or “modernize your tooling.” But from your question at least, those don’t seem to be the case. You are a medium-sized company; the software appears to be doing its job; and there is no clear motivation for a clean slate rebuild or major roto-tilling. That makes this a major update to conform to someone’s architectural preferences. That violates primum non nocere (“first, do no harm”) for questionable benefit.

This is exacerbated by the likelihood that you don’t have good test suites to confirm that a new clean-piece-of-paper build works correctly. (Don’t feel too bad about that–most shops don’t for their internal apps.) And if it’s accounting software, getting data wrong can have extremely negative business consequences. All of this shouts “this will end badly!”–or at least, “you will eventually be unhappy that you decided to rebuild something that already worked for shaky reasons, rather than work on something that could genuinely help the company.” I’ve seen too many clean-slate projects end that way.

Major roto-tilling or start-fresh can work–but you have to have substantial backing, management and users that accept it will take a while and introduce disruption along the way, and most important, a solid reason for going that way.

Instead, I’d suggest you examine what incremental update paths you might have from Delphi 7, and develop a more incremental plan and a more benefits-based motivation for making substantial changes.

1

Not clear whether you are saying your CIO’s issue with your design is the persistent DB connection, or the fact that you use application users mapped to DB users. Neither is necessarily BAD architecture, depending on the requirements. There are many applications that do the same thing, even high end stuff that runs on Oracle Enterprise.

And, even if you eliminate the persistent, direct connection, a competent admin (much less hacker) running your app locally, with or without access to the DB server will be able to connect directly to the database if they work hard enough. Why is that a problem? Sure you don’t want it to be public facing, but internal apps can be managed with firewall rules, or co-resident app + db on the same server. Traditionally, if we embed a database engine in an app we don’t change the port. The security can’t be based on obscurity. Either make sure the app is co-resident so there is no DB network connection except localhost, or ensure it is using an encrypted session, that removes the issue of network snooping, but leaves local hacking possibilities. Outside of that, what is the problem?

Are you not able to dedicate a database instance to the app? Perhaps he wants your app to co-exists on a SQL Server instance with other apps. If so, I can understand the requirement, and it is a good thing. Your choice to map users to real DB users was not a great choice, but it isn’t end of the world, that is more of an old school design that works, but limits your options (requires dedicated database). Now that it works, you have to weigh the costs. Maybe your CIO already has.

Moving on, a local server (local LAN) for locally installed desktop application is the most common model. Otherwise, you either move to a full SaaS web model, or use disconnected synchronization. It isn’t an OLTP web server so I don’t understand the issue with persistent sessions. If he is stuck on this point, there is still some good in rearchitecting it…here are some options, with benefits.

You can port a connected SQL design to a disconnected SOA design by creating a service “agent” (WCF services serving up data calls). You need to map all of your queries over to service calls, implement them in a service layer, then deploy that service layer as the front-end to your database. You can still use fat client data grids all you like, but the data flows via WCF or Data Services from app to broker, broker to DB, and if you need to get fancy, you can implement IQueryable and your own custom data source to allow arbitrary query criteria. I’m not saying it is painless and cheap to transition, but it works. The advantage is you can move your data server anywhere on the Internet (cloud) and your fat app can still work over HTTP/HTTPS. C# / .NET is perfect for this. It’s service interoperability is very rich.

If your DB is not local on a LAN/WAN, and performance/latency is an issue, there are other options that I’ve also had success with, such as implementing a local SQLAnywhere database, replicate the schema of the master DB, and use Mobilink to synchronize against the consolidated database. There are a lot of commercial products with embedded SQLAnywhere or Ultalite DBs, or SQLLite DBs that use this architecture. (Hate to give away tricks of my trade but…)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật