- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Overarchitected Projects
Collapse
X
-
-
I like DI because I've been in situations where I've found it useful for example I've moved a whole load of repositories from EF to Dapper. I could swap between classes in one place which is very convenient. It's also good for short release cycles, you can be working on a new replacement class but if it's not ready for the release just swap it back in the DI file. I also like to see less code in methods, i know it's only a few lines creating a new instance and passing the params but still it's not needed.Originally posted by SpontaneousOrder View PostI actually quite like DI frameworks - but buried down below the surface. Inject the factories, and have those factories build nice coarse grained objects with their dependencies hard-coded if you like.
I don't get the obsession with never being seen to be hard-coding any dependency, while hard-coding them in some uber DI config file somewhere.
I find that it also encourages developers to use interfaces which often helps drum into them the importance of keeping your classes to a single responsibility. Also, makes developers think a little more about design before diving in.
I've gone off TDD/BDD. but yep it helps with mocking.
I will say one thing though, in the past I used Entity Framework alot but I really can't see that advantage of using it over a micro orm. I'm at the stage now where I would avoid a contract if it had EF in it - it just seems a mass of over complications for what is essentially getting data out of a db and mapping it to a class or collection.Last edited by woohoo; 12 February 2016, 12:48.Comment
-
Pretty much agree with what your saying. EF seems like hard work, I use Dapper whenever I can. So much effort for object persistance into the Relational DB, when in these situations a NoSQL object database works much better.Originally posted by woohoo View PostI like DI because I've been in situations where I've found it useful for example I've moved a whole load of repositories from EF to Dapper. I could swap between classes in one place which is very convenient. It's also good for short release cycles, you can be working on a new replacement class but if it's not ready for the release just swap it back in the DI file. I also like to see less code in methods, i know it's only a few lines creating a new instance and passing the params but still it's not needed.
I find that it also encourages developers to use interfaces which often helps drum into them the importance of keeping your classes to a single responsibility. Also, makes developers think a little more about design before diving in.
I've gone off TDD/BDD. but yep it helps with mocking.
I will say one thing though, in the past I used Entity Framework alot but I really can't see that advantage of using it over a micro orm. I'm at the stage now where I would avoid a contract if it had EF in it - it just seems a mass of over complications for what is essentially getting data out of a db and mapping it to a class or collection.Comment
-
In java land it's all annotations or DSLs these days.Originally posted by suityou01 View PostThey don't believe in the XML hell that is other DI frameworks.
But that's the smell right there - XML hell. If you have enough XML for it to be hell, then you are almost certainly configuring fine-grained dependencies for no good reason. DI *frameworks* should be for switching out things at the component level. For example, if you need test versions of classes, then inject a test version of the factory that builds them. Don't configure xml for every single class dependency
Comment
-
EF with XML hell (the model is too complex, or broken, to load into the Visual Studio viewer without it crashing so have to open as XML to make changes) is part of one project solution I've inherited.
The previous contractor still had to abandon LINQ and go direct to database using views and stored procs for some of the more complex data manipulations. There's even nested views with pivots and all sorts of stuff going on. Not exactly easy maintenance.
Overall it feels like a right mess and I think I may only get chance to do any serious refactoring (ideally rip the lot out and replace with Dapper.net) if the performance hit of LinqToEntities gets worse as they pile in loads more data.
So contractors, before you decide to use that new fangled technology so you can put it on your CV please remember it may be another contractor that has to inherit your crud.
Maybe tomorrow, I'll want to settle down. Until tomorrow, I'll just keep moving on.Comment
-
Did not think EF was new fangled tech, was using it years ago, sounds like your predecessor made a bad job of it. Most contractors being experienced and competent do a good job, you got unlucky.Originally posted by Hobosapien View Post
So contractors, before you decide to use that new fangled technology so you can put it on your CV please remember it may be another contractor that has to inherit your crud.
Comment
-
Originally posted by woohoo View PostDid not think EF was new fangled tech, was using it years ago, sounds like your predecessor made a bad job of it. Most contractors being experienced and competent do a good job, you got unlucky.
I think some of the pain comes from them using EF when it was first released as the code goes back to 2008/2009 and having to workaround the then limitations. Typical 'use something new coz we can' scenario, learning as they went along.
Part of the problem with contracts and project based work is there's not always enough flex in the schedule to do some refactoring that really only benefits the sucker landed with the mess.
As the system is now 'legacy' I expect they'll replace it rather than rewrite it at some point. I'm sure the code is self documenting enough for the next victim that comes along.
Maybe tomorrow, I'll want to settle down. Until tomorrow, I'll just keep moving on.Comment
-
Does sound like one of DP's projects to be fair.Originally posted by woohoo View PostDid not think EF was new fangled tech, was using it years ago, sounds like your predecessor made a bad job of it. Most contractors being experienced and competent do a good job, you got unlucky.
Knock first as I might be balancing my chakras.Comment
-
Could be. There were two of them on the original team, Parker and Bic. Though it passed the pen test.Originally posted by suityou01 View PostDoes sound like one of DP's projects to be fair.
Maybe tomorrow, I'll want to settle down. Until tomorrow, I'll just keep moving on.Comment
-
+1 for keeping it simple, so often that principle is lost.Originally posted by woohoo View PostI think we have spaghetti everything
Yep I've seen the same with WCF and I've worked on projects where everything talked to each other via wcf and lots of different patterns- right pain. It was clear that know one understood how or why the project was put together that way and when I made a fix, I would look in the history see something similar and make the changes in the same files. It was clear other people did exactly the same.
I tend to keep it simple with a repository using dapper and a UI project. Do use service classes but only for things that don't necessarily fit into the repository or the controller. I was watching a video from a guy from Israel and basically he was saying don't use a repository do everything in the controller, so using linq accessing the db from the controller. His argument was that you rarely reuse repository methods and end up with a load of similar sounding and doing methods or lots of overloads. Don't quite agree with him on everything but was interesting. Oh I actually quite like dependency injection, sorry
I was hoping for more replies with other useful tools but there you go. Anyway good luck!
IMHO the repository pattern is redundant if you are using something like EF; the data context IS the repository. Dapper is great though a thin wrapper around it is probably a good idea to avoid having raw sql statements in api controllers say. This could be as simple as some additional extension methods on IDbConnection.Comment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- A remote IT contractor's allowable expenses: 10 must-claims in 2026 Today 07:03
- New UK crypto rules now apply. Here’s how mandatory reporting affects contractors Yesterday 07:03
- What the Ray McCann Loan Charge Review means for contractors Jan 14 06:21
- IT contractor demand defied seasonal slump in December 2025 Jan 13 07:10
- Five tax return hacks for contractors as Jan 31st looms Jan 12 07:45
- How to land a temporary technology job in 2026 Jan 9 07:01
- Spring Forecast 2026 ‘won’t put up taxes on contractors’ Jan 8 07:26
- Six things coming to contractors in 2026: a year of change, caution and (maybe) opportunity Jan 7 06:24
- Umbrella companies, beware JSL tunnel vision now that the Employment Rights Act is law Jan 6 06:11
- 26 predictions for UK IT contracting in 2026 Jan 5 07:17

Comment