James Watson
Posts: 2024
Nickname: watson
Registered: Sep, 2005
|
|
Re: Language-Integrated Querying for Scala
|
Posted: Nov 7, 2009 6:21 PM
|
|
> In other words, I don't see any drawbacks. > Maybe you can tell me if I just don't see them or whether > you are PowerScript damaged...
I don't think the drawbacks are fundamental. I think you could structure your code such that the abstraction remains and the LINQ (or similar) is decoupled from the logic.
I was doing maintenance on code that was 5 to 10 years old. Powerscript was (is?) integrated with SQL. Kind of a superset language. You would write your queries and updates right in the middle of basic-esque code. The problem came when the database structure would need to be changed. There was gobs of SQL spread throughout the code. Behind buttons, at startup, on window opens, ... you name it and there was some SQL buried in there.
By the time I was involved, a newer approach had been adopted. You would define a sort of abstract data object which your code would use and resuse. The SQL was encapsulated inside this abstraction such that it could be changed without breaking it's clients.
In a nutshell, the integrated approach was quick and easy. Why bother with abstractions when you can just crack out the query or update that you need. But after a few years, you have hundreds if not thousands of these queries and updates to maintain. This lesson was learned by the PB community. Sybase didn't create the abstract layer approach just for kicks.
So it's not the feature that worries me. Someone like you will probably know to avoid this trap and still use the feature effectively. What worries me is that a lot of people seem way too excited about LINQ, they seem to think that it's a completely novel solution. I fear these people think that LINQ will 'free' them from the burden of creating an abstraction layer. Tools like Hibernate, for all their flaws, force some rigor. The cost of creating new mappings is high enough that people to take time to reuse existing mappings whether they want to or not. Eventually, people will realize why it's important to build abstractions but probably not until it's too late, mainly because we have such poor inter-generational communication in this industry.
|
|