Results 1 to 12 of 12

Thread: Entity Framework

  1. #1
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Entity Framework

    An ORM, or framework for turning innocuous model objects into incomprehensible error messages because you missed out a virtual.

    <RANT>
    throw new ArgumentException (String, String, Exception)

  2. Received thanks from:

    scaryjim (06-12-2013)

  3. #2
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,231
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Entity Framework

    Get a proper dbms and some Connections. You'll be fine

  4. #3
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Entity Framework

    In fairness post magic unicorn it's not bad at all. Would I rather be doing nhibernate mappings? Not really.

    Still, as my mother used to say about a very unreliable car, it still beats the hell out of walking, or writing T-SQL *shudder*.

    What gets me about T-SQL is how arse about face it is.

    SELECT <relies on knowledge from next stanza>
    FROM <oh yeah, lets not put this first, the middle, that makes sense>
    WHERE <condition which merges all projections and filters together>

    I mean even the simplest example is just wrong. T-SQL is just horrible for its job.
    throw new ArgumentException (String, String, Exception)

  5. #4
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,231
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Entity Framework

    *chortle*

    you're not a database person then?

    Given it's based on English, arse-about-facedness was really going to be a given. My nlp lecturer always used to joke about how people try to claim that language is designed to clarify meaning, but in his opinion it's actually far more true to say that language is designed to help disguise meaning.

    Then again, can you imagine the looks you'd get if you asked someone "From the cupboard, get me the pen, the fat blue marker"?

    I like SQL, but that's because I am a database person, and I've used it a lot. Things like EF and nhibernate give me the willies, because I have no idea what it's actually doing to my data under the hood....

  6. #5
    HEXUS.social member finlay666's Avatar
    Join Date
    Aug 2006
    Location
    Newcastle
    Posts
    8,546
    Thanks
    297
    Thanked
    894 times in 535 posts
    • finlay666's system
      • CPU:
      • 3570k
      • Memory:
      • 16gb
      • Graphics card(s):
      • 6950 2gb
      • Case:
      • Fractal R3
      • Operating System:
      • Windows 8
      • Monitor(s):
      • U2713HM and V222H
      • Internet:
      • cable

    Re: Entity Framework

    Which version are you using? It's come on a lot from the original version and MUE (magic unicorn edition aka EF5 IIRC) wasn't too bad, not great though

    It's still not much comparison to Linq2SQL with some nifty bulk inserts and quickness to use with the differences in code first, design first etc, I'll always have a db first, simple as that really (unless it's a quick hack with no prior data reqs in which case I'll have a nosql db like Raven for speed in development)
    H3XU5 Social FAQ
    Quote Originally Posted by tiggerai View Post
    I do like a bit of hot crumpet

  7. #6
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Entity Framework

    Currently been doing it code first, which I prefer in a way. The storing of data isn't important or hard in 2014. It should be based on the design of the domain as dictated by the systems requirements.

    Modelling data relationships just doesn't work in most RDBMS, they focus only on single dimension relationships, people hack their contravariance.
    throw new ArgumentException (String, String, Exception)

  8. #7
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,231
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Entity Framework

    Quote Originally Posted by TheAnimus View Post
    ... The storing of data isn't important ... in 2014. ...


    Maybe not in the domains you're working in, but you can't honestly believe that's true in all cases?

    Quote Originally Posted by TheAnimus View Post
    Modelling data relationships just doesn't work in most RDBMS ...
    Not even vaguely true. Modelling relationships is dead easy in rdbms, you just need to know what you're doing. Are more to the point, implementing the relationships is dead easy once you've modelled them. If you just start by randomly trying to throw tables together and hope something sticks, then sure, you'll struggle, but if you're architecting properly then there really shouldn't be a problem.

  9. #8
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Entity Framework

    What you say of modelling data, and what I say of modelling data is different. I am guessing you are coming from a RMDB point of view.

    Modelling relationships to a degree in a RDBMS is easy, but it isn't necessarily correct. I mean you omitted the most important part of my sentance, contravariance.

    Then when you try and use a traditional relationship it creates all kinds of problems. Let's take something you want to store thats a matrix. Now lets say that you have about 5 different forms of this matrix, and you have about 1000 entities which has one or more of these forms per day. You have history for say 10 years.

    Now how do you store that? Do you have one row per matrix? How? Do you have every column combination possible? Bloat your size. Do you store it as a keyvalue pair thing (ie one row per point) you'll have a massive table, but you could partition it by Entity that the matrix belongs to, then by Date. Performance would suck.

    Yeah, terrible. So you end up hoping you can fit it in some binary structure that you can have one column contain, pulling out only columns that you want as an index. But then you constantly have to fit between code that can parse the binary blob and manage your index columns creation / destruction. You also have a major sync issue, as you have the replication. But lets ignore those. You now have say ~12M rows. Now say you've a couple of tables like that, you have a relationship between your Entities declartion table. All of a sudden adding / removing an Entity takes forever.

    The storing of data today shouldn't be important. It really shouldn't be. The idea of defining your Tables, Relationships and Indexes manually should be out of date. You should be able to constantly determine these based on the code Model Objects.
    throw new ArgumentException (String, String, Exception)

  10. #9
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,231
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Entity Framework

    Quote Originally Posted by TheAnimus View Post
    ... Let's take something you want to store thats a matrix. Now lets say that you have about 5 different forms of this matrix, and you have about 1000 entities which has one or more of these forms per day. You have history for say 10 years.

    Now how do you store that? ...
    Erm ... mu? Still too abstract. How am I supposed to model data interactions based on "theres some matrices that are slightly different and you need to store lots of them", let alone then suggest an implementation? Implementation plans require concrete requirements, which that most certainly isn't.

    Yes, we almost certainly think of modelling data in different ways, but that's not because I'm a DB person, it's because I'm a data person. Data is more than just how you persist the current and previous states of your program. And personally I like being able to control how the validation and integrity of that data is being managed. I'm not sure you can effectively and efficiently do that with EF.

  11. #10
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Entity Framework

    A matrix is too abstract?

    Ok, you have a series of "Implied Volatility Matrices" these have an axis of time duration ie (1M,2M,3M,6M,1Y) and percentage strike (50%,70%,80%,90%,100%,110%,120%,130%,150%), that has a double precision floating point value for it.

    But some have different tenors (time duration sets) others have different percentage strikes (say every 5%).

    Obviously this fits horribly in a RDBMS.

    Do you know what I mean by contravariance in an OOD world? It is a classic example of a problem that doesn't fit in the limited dimensional world.

    Most real world problems are n-space (multidimensional, n-connected in graph theory).
    throw new ArgumentException (String, String, Exception)

  12. #11
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: Entity Framework

    I'm really into EF at the mo, when I first tried it a few years ago now, it was absolutely godawful. The code the code-first command-line migrations tool comes up with is a bit ropey still if your model is complex - that could definately use some improvement - but simple enough to correct. Great for prototyping stuff practically without touching RDBMS software.
    To err is human. To really foul things up ... you need a computer.

  13. #12
    Registered+
    Join Date
    Dec 2013
    Posts
    13
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: Entity Framework

    Which version of EF you are using? Can you post you Entity classes? It sound like some relationships didn't match. Code first usually don't have such problem.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •