Tag Info

Hot answers tagged

12

A test is a test, and what you described is an application, not a test. Don't write code that you don't want run again and again and again as a unit test. Write a console app, or a winforms app, or an add-in or whatever, but NOT as a test. Feel free to write a unit test for your code, though. What you think is a one-off code will often wind up sticking ...


9

Option 1 creates a tight-coupling between the domain model and the view. This contravenes the very problem view models are designed to solve. A view models "reason to change" is if the view itself changes. By putting a domain model object in the view model, you're introducing another reason to change (eg the domain changed). This is a clear indication of a ...


7

You might want to look at the answer to this similar question here: http://stackoverflow.com/questions/11329823/add-where-clauses-to-sql-dynamically-programmatically We've found that a SPROC which takes in a bunch of optional parameters and implements the filter like this : CREATE PROC MyProc (@optionalParam1 NVARCHAR(50)=NULL, @optionalParam2 INT=NULL) AS ...


5

The only ethical considerations that I can think of are those relating to accessibility, for which there might even be legal implications. Otherwise, it's just a choice, as is the choice of some users deciding not to use your software because you forced them to use Javascript. That said, students are generally tech-savvy enough that the overwhelming ...


4

hang on - you want to write a unit test that actually performs the work you want doing?? It does seem to me that you've violating the principle of keeping it simple, by trying to fudge unit test framework to do something it wasn't intended. Make a console app, it'll be easier to deploy to an environment that might not have your version of the dev tools ...


3

Start with whatever you think is easier to implement (I guess option 2). Then measure the performance for real world data. Only start optimizing when needed, not beforehand. By the way, depending on how complex your search filters are, your task may not be easily solved without dynamic SQL. So even when you use a stored procedure, that most probably won't ...


3

Aren't you, maybe, overthinking this concern a little? Anyway: in the past I saw people advocating black, dark, and grey web designs, with the rationale that it consumes less energy. This could have had made a very little sense with CRT monitors, (though the save was pretty negligible and all) with LCD displays it is now complete nonsense. (backlight: ...


3

You probably want some equivalent of the Portland, OR based Sustainability at Work program to help you understand the parameters. You may have a more locally suitable program, but the general framework will be similar enough to answer your general question.


2

I think for this kind of application, a generate button would probably be undesirable from a UX perspective, especially if the operation performed is as trivial as you make it sound. Here's what I hacked together in a few minutes, for what I think you are approximately describing: http://jsfiddle.net/qtY38/4/ (Is jsfiddle still en-vogue?) The meat being: ...


2

This is fairly generic advice for any problem, but it may help. Start with the data. Work out what information you'll need to store, how each piece of information relates to the others. If you get the data structure wrong, you can spend an incredible amount of time writing code to "force" it into the correct structure. Caching is "easy to apply" late in ...


2

I've been advocating DSLs for a long time, but I worry about what happens to Good Ideas when they become bandwagons. Products get built that advertise The Good Idea, promising all you have to do is get one, and you'll be in the in-group, without having to think very carefully about what it means. What is a language? It's a vocabulary and syntax in which ...


2

Principles and mantras are sometimes valuable for guiding design... but here's my practical answer: Imagine your view models being serialized into JSON or XML. If you try and serialize your domain models you're going to end up with a hideous mess of text and most likely run into issues with circular references and other issues. The purpose of a view model ...


2

Option 1 is preferable as it avoids code duplication. That's it. If the domain model changes significantly , it's almost certain that the view will have to change anyway. With option 2, then you have to change the view model AND the builder as well as the view itself. That kind of thing is absolute poison for maintinability. YAGNI. The point of having a ...


2

I would consider having "auto-approved" tags for the cases where a Level 2 or 3 user creates a request. My presumption is that you are tracking: who creates who approves at level 2 who approves at level 3 So your status could then go through the following: User_submit Approved_Level2 or Auto_Approved_L2 Approved_Level3 or Auto_Approved_L3 ...


2

First off, scrum is specifically designed for teams that are the size you describe, more and more developers are becoming familiar with it, and when it works, it works really well. Scrum is really only a framework, however--you have to figure out what practices best work in your environment Other methodologies include: RUP - the Rational Unified Process. ...


2

IMHO it's not really the application that is not tied to a DB structure but its architecture. In that case, we'll speak about Clean Architecture. As Uncle Bob says: a good architecture allows you to defer critical decisions like the UI, frameworks, database, etc Have a look at this pretty interesting article as well, where it tells why: ...


2

In a comment, you said: What i am tryin to get out of this post is WHY not to do it. Unit tests are meant to run to check that code works as intended. Because of this, they are often (I wish I could say "always") used with continuous integration, and automatically run whenever a new commit was made to the code. This can be several times in an hour, ...


2

I think you're looking at this the wrong way. What is the purpose of a unit test? To test that some piece of code works correctly. If that's not what you want to do, then don't use a unit test. What you should do is to create a separate console application that references your other projects. This way, you can use all the code you already have. A good place ...


2

Is it a unit test? some one-off code in c#.net that will do some db manipulation Ok. Database manipulation doesn't mean database access. You may have used a mock of the database in order to concentrate on the manipulation itself. of existing records So the code should work for only a predefined set of data? If you're not creating data processing ...


1

Because I am a web developer, I am using web technologies to solve the problem. I'm afraid of my limited mindset and picking wrong tools for the job. You're falling into the "when all you have is a hammer, everything looks like a nail" trap. But you're able to recognize it, which is a very good thing. Is HTTP/HTTPS good enough for file ...


1

Is HTTP/HTTPS good enough for file transfer? Many applications rely on HTTP/HTTPS for file transfers, best example is mega.com. So as you mentioned there may be better ways to keep it in sync, but it's not definitely wrong to use HTTP/HTTPS for file transfers. Is Node.js good enough for working with File System? Node.js is a really great system and of ...


1

I see two main ways to develop this system. Office solution The first is to write some VBA that parses a file (such as an Excel worksheet or an Access database) and builds a Word document. I would suggest if you go down this path you use a properly designed database. Pros You can still edit the files in Office Staff are familiar with the system Cons ...


1

That's a pretty good approach. You've separated the concerns into projects and referenced the projects where they are used. That's good. Since you've tagged this Visual Studio, I'm going to share how I structure my .NET software projects. Typically I'll have these three projects, each contained within a single Visual Studio solution (.sln): PointOfSale ...


1

I work for a helicopter company we do lots of work for major utility companies in the UK. They require us to have an envionmental protection system very similar to a health and safety system. ISO 14000 may be rather overblown for your company, but it may well point you in the right direction http://www.iso.org/iso/iso_14000_essentials From my experience, ...


1

I like not relying on the schema of the database too much. It makes later changes harder. I would have one Table users: <user-id> <user name> another Table local-permissions: <user-id> <channel(-id)> <permission> and yet another Table: global-permissions: <user-id> <permission> I would use a String column ...


1

We will be seeing a lot more about Domain Specific Languages in future, judging by the people who are talking about them now- I've noticed Martin Fowler talking about them a lot too and a few interesting articles through Lambda The Ultimate on the topic, among others. That suggests to me that this is definitely a direction in which the wind is blowing with ...


1

Is creating a photo gallery in a tool like Picasa or Flickr an option? They have options for sharing as well, see: Picasa & Flickr ... and you don't have to re-invent the wheel. HTH, KM


1

Due to the simple nature of your site and the limited CMS-type needs, I would not implement a full CMS and just create a simple, upload/modify/delete page for the monthly offers. If you plan or expect more CMS-type activities to begin taking place in the future you might want to consider setting up a CMS though. Also consider that training the user. Your ...


1

Well, it might be worth it if the CMS has features (in terms of display and layout and themes and such) that would save you coding time (assuming custom-code is your alternative). Plus, they are likely to be fixed/updated/featured-added by someone else so you don't have to do any of that. You lose control of the code-base and you have to maintaint the config ...



Only top voted, non community-wiki answers of a minimum length are eligible