Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
more like dICK
Feb 15, 2010

This is inevitable.

Terry :swoon:

Adbot
ADBOT LOVES YOU

Morkai
May 2, 2004

aaag babbys

Notorious b.s.d. posted:

in a database accessed by a single application, stored procs have no impact on data integrity

efficiency almost never matters to anyone, ever. they say it matters, but in reality they'd rather have the application on time

why anyone is letting more than one application into a single db is beyond me. i am pretty sure that is one of the things that a proper soa solves and why isn't everyone doing that yet?

most of us have to work with legacy code and the hellish places it lives, i get it. but outside of that why forcefully subject yourself to pain when you don't have to (and presumably don't want to)?

Shaggar
Apr 26, 2006
b/c most companies do more than one thing

FamDav
Mar 29, 2008

Shaggar posted:

b/c most companies do more than one thing

my nigga have you heard about soa

Morkai
May 2, 2004

aaag babbys

FamDav posted:

my nigga have you heard about soa

gently caress yeah this

Shaggar
Apr 26, 2006

FamDav posted:

my nigga have you heard about soa

i have lots of soa but i don't have the time to convert everything especially the way old legacy poo poo.

FamDav
Mar 29, 2008

Shaggar posted:

i have lots of soa but i don't have the time to convert everything especially the way old legacy poo poo.

k

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD
usually the SOA is so controlled good luck getting any changes made to it in a timely manner so everyone subverts the process and starts writing to the database directly

ORMs are still fine in 99% of cases though
and sprocs are poo poo in 99% of cases but unfortunately you need to use them for certain things

power botton
Nov 2, 2011

ORMs are terrible. lol if your data model is so poorly designed/trivial that using ORMs is actually pleasant.

a generation of coders growing up on ORMs and refuse to learn anything about SQL and coincidentally nosql becomes a fad. weird.

power botton
Nov 2, 2011

hey i gotta store information about literally 100s of users and orms work fine for me? don't see the need for sprocs or statement mapping?

cowboy beepboop
Feb 24, 2001

if you saw our database you'd wish the developers back in 1990 or whatever the gently caress had an orm to guide them

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Morkai posted:

i don't understand this:


how does using an orm negatively impact data integrity? maybe you're just doing poo poo wrong (or have only seen it done wrong) and making snap judgements about it?

have fun projecting your tables to a new ORM when your current one is abandoned/sucks/whatever

SQL is not hard, statement mappers make it literally trivial to map rows to objects

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

power botton posted:

hey i gotta store information about literally 100s of users and orms work fine for me? don't see the need for sprocs or statement mapping?

ya in this case gently caress it im talking about millions of rows of biz data not mickey mouse poo poo


also if you want different schemas than what orms generate well

star schema 4 lyfe

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Malcolm XML posted:

ya in this case gently caress it im talking about millions of rows of biz data not mickey mouse poo poo


also if you want different schemas than what orms generate well

star schema 4 lyfe

yeah u can contort your orm into reflecting the rows but why bother at that point

the object relational impedance mismatch is big and for tiny projects it doesn't matter

power botton
Nov 2, 2011

Malcolm XML posted:

ya in this case gently caress it im talking about millions of rows of biz data not mickey mouse poo poo


also if you want different schemas than what orms generate well

star schema 4 lyfe

thats the point everyone who uses ORMs does mickey mouse web development and calling up Users.get(@userid) is like half their queries

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Malcolm XML posted:

yeah u can contort your orm into reflecting the rows but why bother at that point

the object relational impedance mismatch is big and for tiny projects it doesn't matter

ask me about working on a project where we use entity framework to a nosql table storage mechanism :negative:

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

power botton posted:

thats the point everyone who uses ORMs does mickey mouse web development and calling up Users.get(@userid) is like half their queries

yeah exactly in that case their data is irrelevant

I bet they don't even do tiered backups

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Malcolm XML posted:

ask me about working on a project where we use entity framework to a nosql table storage mechanism :negative:

for literally billions of updates a day

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Morkai posted:

why anyone is letting more than one application into a single db is beyond me. i am pretty sure that is one of the things that a proper soa solves and why isn't everyone doing that yet?

most of us have to work with legacy code and the hellish places it lives, i get it. but outside of that why forcefully subject yourself to pain when you don't have to (and presumably don't want to)?

perhaps...there is a many to many relationship between apps and db's!!!!

makes u think

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

Malcolm XML posted:

1. have fun projecting your tables to a new ORM when your current one is abandoned/sucks/whatever

2. SQL is not hard, statement mappers make it literally trivial to map rows to objects

3. ya in this case gently caress it im talking about millions of rows of biz data not mickey mouse poo poo

1. this doesn't really happen often enough to be a concern. and you projected your tables to the first ORM in any case so do it with the second

2. irrelevant how hard it is. sql is objectively bad for most purposes where it could be replaced by application code.

3. data volume is irrelevant. ORMs are not significantly slower at inserting than sprocs

BONGHITZ
Jan 1, 1970

enthusiastic about databases

Shaggar
Apr 26, 2006

~Coxy posted:

1. this doesn't really happen often enough to be a concern. and you projected your tables to the first ORM in any case so do it with the second

2. irrelevant how hard it is. sql is objectively bad for most purposes where it could be replaced by application code.

3. data volume is irrelevant. ORMs are not significantly slower at inserting than sprocs

lol

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

~Coxy posted:

2. irrelevant how hard it is. sql is objectively bad for most purposes where it could be replaced by application code.

nope. nope, nope, nope. there's nothing grosser than seeing someone take 15 lines to fetch a row from a table by instantiating some bullshit SelectQueryBuilder and calling a dozen methods on it instead of just writing a line of sql.

~Coxy posted:

3. data volume is irrelevant. ORMs are not significantly slower at inserting than sprocs

ahaha

Bloody
Mar 3, 2013

entity framework is trivially simple and i used it by designing my database first and then it generated models that trivially map to my tables where exactly am i contorting anything to anything else

Bloody
Mar 3, 2013

nah we'll just use this driver and poo poo
code:
Connection con = null;
        PreparedStatement pst = null;

        String url = "jdbc:postgresql://localhost/testdb";
        String user = "user12";
        String password = "34klq*";

        try {

            int id = 6;
            String author = "Trygve Gulbranssen";
            con = DriverManager.getConnection(url, user, password);

            String stm = "INSERT INTO authors(id, name) VALUES(?, ?)";
            pst = con.prepareStatement(stm);
            pst.setInt(1, id);
            pst.setString(2, author);                    
            pst.executeUpdate();

        } catch (SQLException ex) {
            Logger lgr = Logger.getLogger(Prepared.class.getName());
            lgr.log(Level.SEVERE, ex.getMessage(), ex);

        } finally {

            try {
                if (pst != null) {
                    pst.close();
                }
                if (con != null) {
                    con.close();
                }

            } catch (SQLException ex) {
                Logger lgr = Logger.getLogger(Prepared.class.getName());
                lgr.log(Level.SEVERE, ex.getMessage(), ex);
            }
        }
oh

Shaggar
Apr 26, 2006

Bloody posted:

entity framework is trivially simple and i used it by designing my database first and then it generated models that trivially map to my tables where exactly am i contorting anything to anything else

ef really isn't that simple and is very bad for anything more advanced than the examples on asp.net

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD
var foos = context.Foos;

wow that 15 lines of code sure was a lot more effort than writing some crappy boilerplate CRUD sql sproc

Valeyard
Mar 30, 2012


Grimey Drawer

Bloody posted:

nah we'll just use this driver and poo poo
code:
Connection con = null;
        PreparedStatement pst = null;

        String url = "jdbc:postgresql://localhost/testdb";
        String user = "user12";
        String password = "34klq*";

        try {

            int id = 6;
            String author = "Trygve Gulbranssen";
            con = DriverManager.getConnection(url, user, password);

            String stm = "INSERT INTO authors(id, name) VALUES(?, ?)";
            pst = con.prepareStatement(stm);
            pst.setInt(1, id);
            pst.setString(2, author);                    
            pst.executeUpdate();

        } catch (SQLException ex) {
            Logger lgr = Logger.getLogger(Prepared.class.getName());
            lgr.log(Level.SEVERE, ex.getMessage(), ex);

        } finally {

            try {
                if (pst != null) {
                    pst.close();
                }
                if (con != null) {
                    con.close();
                }

            } catch (SQLException ex) {
                Logger lgr = Logger.getLogger(Prepared.class.getName());
                lgr.log(Level.SEVERE, ex.getMessage(), ex);
            }
        }
oh

i had to do an assignment recently using jdbc and it owned in comparison to the other lovely pure sql stuff

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

Bloody posted:

entity framework is trivially simple and i used it by designing my database first and then it generated models that trivially map to my tables where exactly am i contorting anything to anything else

yep

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

Shaggar posted:

ef really isn't that simple and is very bad for anything more advanced than the examples on asp.net

maybe try telling us what's so bad about it

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

Bloody posted:

nah we'll just use this driver and poo poo
code:
Connection con = null;
        PreparedStatement pst = null;

        String url = "jdbc:postgresql://localhost/testdb";
        String user = "user12";
        String password = "34klq*";

        try {

            int id = 6;
            String author = "Trygve Gulbranssen";
            con = DriverManager.getConnection(url, user, password);

            String stm = "INSERT INTO authors(id, name) VALUES(?, ?)";
            pst = con.prepareStatement(stm);
            pst.setInt(1, id);
            pst.setString(2, author);                    
            pst.executeUpdate();

        } catch (SQLException ex) {
            Logger lgr = Logger.getLogger(Prepared.class.getName());
            lgr.log(Level.SEVERE, ex.getMessage(), ex);

        } finally {

            try {
                if (pst != null) {
                    pst.close();
                }
                if (con != null) {
                    con.close();
                }

            } catch (SQLException ex) {
                Logger lgr = Logger.getLogger(Prepared.class.getName());
                lgr.log(Level.SEVERE, ex.getMessage(), ex);
            }
        }
oh

we use devart for oracle at work with oracle types for entities and sprocs for each one and it's even worse

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
ok no fair including 200 lines of boilerplate connection setup code, i don't give a poo poo about logging, and good languages automatically close the connection once the script finishes running. but this is what really bugs me:

Bloody posted:

String stm = "INSERT INTO authors(id, name) VALUES(?, ?)";
pst = con.prepareStatement(stm);
pst.setInt(1, id);
pst.setString(2, author);
pst.executeUpdate();

how come nobody ever wraps dumb poo poo like this in something that makes it more succinct? calling a method for every single parameter you want to bind is hilariously verbose. this is what that should look like (in a good language): Db::insert('authors', [$id, $author]);

Shaggar
Apr 26, 2006
entity objects require state janitoring if you're doing anything other than just reading them. its a huge pain in the dick to use. is the object up to date? has it been saved? what the hell changed it last? oops you changed it too many times now its invalid, recreate it and try again!

if you want to use ef, use it for statement mapping so you can just do context.doThing(parameters) instead of that retarded object state bullshit.

Notorious b.s.d.
Jan 25, 2003

by Reene

Malcolm XML posted:

have fun projecting your tables to a new ORM when your current one is abandoned/sucks/whatever

SQL is not hard, statement mappers make it literally trivial to map rows to objects

Malcolm XML posted:

ya in this case gently caress it im talking about millions of rows of biz data not mickey mouse poo poo


also if you want different schemas than what orms generate well

star schema 4 lyfe

you've never used hibernate

not every orm is a loving activerecord shitshow disaster

Shaggar
Apr 26, 2006
hibernate sucks

jony ive aces
Jun 14, 2012

designer of the lomarf car


Buglord
Unfortunately, your IDE (has/lacks):
[x] vi keybindings
[x] emacs keybindings

In conclusion, this is what I think of you:
[ ] You have some interesting ideas, but this won't fly.
[ ] This is a bad IDE, and you should feel bad for creating it.
[x] Programming in this IDE is an adequate punishment for inventing it.

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
yeah hibernate does suck

Shaggar
Apr 26, 2006
mybatis-spring owns so much cause there wont be any references to any database stuff anywhere in ur code.

Cybernetic Vermin
Apr 18, 2005

Notorious b.s.d. posted:

you've never used hibernate

not every orm is a loving activerecord shitshow disaster

you've never used python

not every programming language is a loving javascript shitshow disaster :smug:

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
all of my database dependencies are runtime

  • Locked thread