|
I've not used CW, but I am currently working on an MVC project that uses Ninject. As far as DI/IoC, I'd say it has helped keep me on the right track. That is, I have to think things out ahead of time, and avoid writing a function in one view that I copy/paste into another view (or action). With the logic centralized into a repository, I can easily reuse that logic without taking the easy way out and writing sloppy/unmaintainable/hard to refactor code. I was also using it at the beginning of my project to create a "fake" repository that I used to code the views without doing the plumbing in the CMS to provide real data.
It also has other hypothetical benefits which I have not yet made use of. One being that I can test to code more easily. Another being that I can reuse the views for other projects (e.g., standard widgets). I could also easily swap out components (e.g., the data store) and do some central changes (e.g., optimize performance by caching some operations).
One cool use case is that you can use it to use debug code without worrying about it making its way to your production environment. For example, if you need to ensure your CSS/JavaScript files are never cached while debugging, you simply apply a query string to the file where it is referenced. In your real repository (the one you use with release builds), the cache-buster query string is empty. In your fake repository, the cache-buster changes with each page request. You can swap out other settings in a similar fashion to ensure the development process is quicker without having to worry about scrubbing your debug values/logic when deploying to production.
|
|
|
|
|
Hmm, I like the idea of it forcing better structure. I may be the only developer on this project, but I'm also not a morning person, so I can be sloppy at times. Component reuse is a plus too, but so far WPF's MVVM structure has made that pretty simple.
The last concern I have right now is that in terms of code structure, WPF and DI/IoC may be a little redundant. Different layouts both accomplishing the same goal. I might use some light DI/IoC for the model, and do the GUIs normally.
|
|
|
|
|
...but in this case[^] it's got to be worth a try...
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
Shared.
speramus in juniperus
|
|
|
|
|
Liked and Shared! Always there for a good cause!
|
|
|
|
|
|
I applaud the effort, but just how many lives does that fan have?
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Hopefully, not more than 10,139,267...
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
There is a new band on the scene: 1023MB
But they haven't got any gigs yet...
sorry, sorry...but it is Friday...
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
I was thinking of calling my band 1073741824. mkay?
speramus in juniperus
|
|
|
|
|
|
Are we bored again?
If first you don't succeed recurse[^]!
|
|
|
|
|
Word.
Software Zen: delete this;
|
|
|
|
|
We've been using .LESS and Javascript packagers and minifiers for years and the concept of writing a single file and having that generate multiple files is brilliant.
For example, we'll update a JavaScript file and have the updates automatically be included in a number of other files, and also have minified versions of those files be created too.
We have a situation where we're porting some SQL Server stuff to MySQL (well, probably MariaDB) and the syntax for stored procedures is similar but not the same. We've been playing with T4 templates that would allow us to have all versions in one file, and then have .sql and .mysql versions of the stored procedure files created. It works, but it's not seamless.
So I was wondering: has anyone else played with any file templating solutions like this (and not necessarily for SQL files - anything really)? We're *this* close to writing our own VS extension but didn't want to go down that path if there's a neater solution or better approach to these things.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
What's wrong with you man, a couple of regexp and knock it all through sed .
Simples.
speramus in juniperus
|
|
|
|
|
Totally a legit way to do it, but clunky.
I looking for ideas that others have used. Preferably something that's a massive overkill for the problem at hand. Something that would appear on Software Developers Gone Wild or something.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
I thought the whole idea of Codeproject was that it was about de-ve-lop-ing, not this copy'n'paste bull!
Bring back punched cards, that's what I say!
speramus in juniperus
|
|
|
|
|
I'm sure there's a way to pipe the regex/sed solution trough multiple emacs/vim addons too.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
I'm using T4 templates to generate a number of javascript proxy objects for the json methods on our controlers, but we have to remember to click the transform button whenever we make a change. We're also using a plugin for scss flies instead of LESS, but I haven't seen anything like that for sql.
|
|
|
|
|
T4 is useful... I use it extensively whenever I'm making a proxy layer in .NET. A little reflection to iterate over the classes and methods, pick up attributes to modify the template behavior, and generate one giant file full of partial classes with boilerplate code.
Debugging it is a pain though.
Oh, and unless you install an extension or a pre-build script or something, it doesn't automatically update. Gotta open up the T4 template and Save, and that will re-generate the output file. THEN compile.
|
|
|
|
|
There is a transform all template toolbar button that you can map to the ui. It's not as nice as auto updating but better than finding the file.
|
|
|
|
|
Still, would be better if it re-generated whenever the dependent files changed... Of course, that'd require it to know what the dependent files are.
|
|
|
|
|
Chris Maunder wrote: So I was wondering: has anyone else played with any file templating solutions like this
I have been using code generation for years.
That has included generating basically entire backends and database layers from external languages like C# and java down to schemas and stored procs.
In my experience generating non-CRUD stored procs for multiple database targets is at best difficult and it isn't worth it. Because of differences and complexity one ends up providing a mechanism to insert custom code for different targets. So rather than having X number of different procs that one must manage one then has X number of different fragments, or worse, X * multiplier fragments in a system that one must understand in detail to update.
I have no problem with CRUD proc generation across multiple platforms. But there are multiple frameworks these days that at least provide an alternative to that.
Of course if you are the only one that must maintain the system then the experience and technical challenge is a factor.
|
|
|
|
|
I know - we should just shift to entity framework and be done with it.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
I've saved a link to this!
|
|
|
|