Implement the Business Services in PL/SQL or Java? Favor/Cons?
I work for an enterprise that will create a web-service stack architecture (probability rest based), I'm the technical leader involved. This architecture will be created using the Java Platform, but I have a problem with some team´s members: they are from Oracle´s old school (i.e. they did the legacy using PL/SQL and in their head the business logic should be only on the database, with just a little java layer calling that), I have some arguments about this but I would like to know your arguments in favor or cons about the question开发者_如何转开发.
Java Favor (in my opinion)
- Scalability
- Monitoring
- Object Oriented Language
- Sync/Async process
- Rich domain
- Testability
You may find the following articles interesting and helpful:
- A Working Definition of Business Logic, with Implications for CRUD Code
- Business Logic: From Working Definition to Rigorous Definition
- Theorems Regarding Business Logic
- Can You Really Create A Business Logic Layer?
I worked on such a project using MS SQL rather than Oracle. It was not a pleasant experience. The trouble is that T-SQL is not a very modern language and so we weren't as productive as we could have been and there was more code duplication than there would have been otherwise.
There's an argument to be made that the productivity of the developer is more important than the lang, so if these guys are just that good, so what. But you're not going to find a lot of young developers who will want to work that way.
It has to be a judicial decision. Either one can be more suitable based on the use case. For a simple example
If you have a business rule which say requires data from a number of tables and based on the data received, it decides to perform a final database operation (insert or update), then in my view pl/sql procedure is the place to do it. Since this will save n/w time and bandwidth and will be a touch faster.
It's a bit tricky question, but a very thought provoking one.
Starting from Oracle 9i,It has complete support for Java Stored Procedures, i.e. you can store Java classes inside database server and execute them as you execute Pl/Sql procedures.
It would always be a good option to choose a perfect worker rather than sticking on to sentiments! As you have stated Java has presence and support for versatile concepts across various domains.
Here I can think out of following options for an optimal solution acceptable by everybody.
- Write required procedures in java, store them into server
- Write at least major requirements, which really reduce complexity of task compared to Pl/Sql and call them in Pl/Sql
- Without polluting either of environments maintain separate layers, which is second best option
精彩评论