General Questions about Entity Framework vs. Enter

2019-04-18 05:02发布

问题:

Brief blurb,

My skill in .net has been called "innovative" but I would prefer it be exemplary. Basically, I need a mentor. I own the domain name codeologist.com and I am going to live up to that name but in order to do so I need a mentor & community.

On to the questions:

  1. Entity Framework - I'd imagine this is an intense framework mapping objects from a factory while retaining the integrity and state of objects within the system. At least, that's what I can intuit from about 15 minutes of a podcast I listened to. RTFM I know but is that a correct general assessment?

  2. Enterprise Library - Killer. Used most blocks at least as example applications.

  3. Domain Driven Design - What are some tricks to going from thinking like an ERD/ORM to domain driven design? Pros vs. Cons?

  4. Agile vs. SCRUM - Is there a difference really?

  5. Unit testing - The last thing I think of. Can't get automated web ui testing setup correctly also need help with NAnt/MSBuild scripts from a VSS 2005 repository. A full example in source would be really nice, perhaps including scheduling.

  6. Bare essential TSQL - What is considered the bare minimum professional grade TSQL statements for enterprise development? Like ROWCOUNT, TRANSACTION, ROLLBACK, flow control statements, in-line sql & security concerns for CRUD methods.

  7. It is conceivable to integrate MVC2/3, Entity Framework, Enterprise Library and SilverLight web front ends? Even perhaps Sharepoint?

  8. I asked a guy I met once when should I use Linq, his reply was "always use the force".

  9. When learning a new language what games/apps do you write? What are some good exercises for those about to code? (We salute you!)

  10. What books would you recommend for general programming theory, enterprise architecture & business analysis?

Ok probably no one will respond but these are burning questions I've had in my gut and I just had to get all that out.

Geek For Life.

回答1:

I cannot answer all of your questions, but I will take a shot at a few of them

  1. (Question 1) Basically your assessment sounds right. It could also be said that EF 'abstracts away' the SQL that is otherwise needed to persist data to a persistent (generally a disk drive) store.

  2. (Question 7) Yes. However, it has been my experience that many (if not most) software developers are unable or unwilling to deal with that many different technologies concurrently. The average Stack Overflow member does NOT suffer from this particular malady.

  3. (Question 8) That guy is right. LINQ rocks. Everytime you can replace a foreach loop with a LINQ statement your code gets easier to read and maintain. Remember LINQ (Lambdas) can be used for much more than querying databases. The LINQ syntax to sort a collection is as simple as sorting in SQL statements, but has the added advantage of being able to sort in memory. Learn LINQ completely, it is your friend.

  4. (Question 9) I usually dive right into a real work project. Then refactor after I've lerned a few things. The best learning comes from doing. You learn more from doing it wrong, seing the problem and making it right than any other methodolgy I know.

  5. (Question 10) There two books have been around a while but are still important.
    Design Patterns Elements of Reusable Object Oriented Software
    This book is commonly referred to as the 'Gang of Four' or GOF book.
    and
    Patterns of Enterprise Application Architecture by Martin Fowler



回答2:

Ok, let's see.

1) Entity Framework - it's mostly an ORM (Object-Relational Mapper). The idea of EF is actually a little more ambitious than that; the true goal is to create the uber-be-all modelling framework for all kinds of data (that's EDM) and then provide software that implements and supports that model (EF). In practice, though, it's an ORM.

2) Umm, is there actually a question here?

3) Run, don't walk, to buy Eric Evan's Domain Driven Design. This is the book that defined the DDD vocabulary everyone uses today. Want to know what a repository really is? It's in here.

4) Hell yes. Agile is the ideas embodied in the Agile Manifesto. It's the underlying principles. SCRUM is a particular methodology (well, methodology framework) that conforms to those principles. There are lots of agile methods (Extreme Programming and Crystal Clear are two examples off the top of my head), but they all share the same underlying principles.

5) Well, it should be the first thing you think of, but you should be doing Test Driven Design, not Unit Testing. TDD is a design / development activity, Unit Testing is a test activity. Web UI testing is a pain, granted. Although your question is a little vague and it looks like multipart. You might want to split this one out into separate, more specific questions.

6) I'm not really a SQL guy, but I've gotten pretty far with just the basics - SELECT is remarkably complicated just for starters. Although I'm of the opinion that if you need conditional logic or loops inside your TSQL sprocs, something has gone terribly, terribly wrong. You're better off really understanding the theory - the relational model, normal forms, and the various data types and how they behave.

7) Yes, for most of them. Each one plays a different part in the software stack. Assuming you're doing a RIA style client, you'd have the silverlight app running in the browser providing the UI, communicating back to a web server that's responding via an MVC site. Entlib is useful in implementing that MVC app. If you're using Silverlight, you will be using EF for data access most likely. You can also use it to hit the database inside the MVC app. Sharepoint may be a little problematic - it's also a web server thing, so you could consider it a competitor for the MVC app. But you could also use it as a data store.

8) LINQ rocks. It's a different way of thinking about certain problems around managing sequence of data. The thing I like about it is that it's very composable - you can filter, transform, and operate on data in lots of ways, and pass those things around and do more filtering / transforming along the way and it just all slots together seamlessly. Plus, the language stuff needed to implement LINQ brought in a whole TON of new power to C# / VB.NET which is really, really cool.

9) Hello world is always useful just to make sure you've got the editor-compiler-debugger toolchain nailed down and working. After that, I tend to dive into whatever I feel like. When I first tried Silverlight I did a little game. I may do a small parser. Or just try to throw some windows on the screen. I don't have a standard new project.

10) Agreed on the recommendations for Design Patterns and POEAA. I also strongly recommend The Pragmatic Programmer by Hunt and Thomas. It's not about the theory of programming, it's about the craftsmanship of building software.