design

How does one go about breaking a monolithic application into web-services?

Not having dealt much with creating web-services, either from scratch, or by breaking apart an existing application, where does one start? Should a web-service encapsulate an entity, much like a class does, or should the service have more/less to it? I realize that much of this is based on a case by case analysis of what the needs are,...

Design by Contract library (interface) thoughts?

I am looking at design by contract for a Java library, this what I came up with so far in terms of the interface. The user could call executeContract and executeContract invokes invokeContract after calling 'require'. ensure is called after executeContract to ensure the correctness of what is returned by invokeContract. This code also...

Project type to implement a receiving 'server' app.

I'm developing a server app for the client that I've already made. The idea is that the client(s) throughout the day create files (serialized objects) that, at the end of the day, need to make their way to the server so that those files can be analyzed and have their data inserted into the main db. I'm wondering if there is a better pro...

Modern C++ Design Generic programming and Design Patterns Applied

I have purchase this book for our group in the company, perhaps, to improve our design skills and ultimately have a better programming practices. As I read it, I find, mostly, a set of nifty tricks that can be used with template, and not sure if it is worthwhile - and not detrimental-to incorporate it into our code thus introducing c...

What is the best CASE tool for database development and why?

I know there are a large number of CASE tools out there, some better than others, but what are the ones used by those in the field, and why do you use those specific tools? In this case, I am just interested in CASE tools for database design, and more specifically, ones that will let me "draw" the schema diagram, and then will create th...

Virtual inheritance in C++ usages/tricks

I've never used it in the professional software even though in our shop, and others I have worked for, we design large scale systems. The only time I messed with virtual inheritance was during my interview in a company. Nonetheless, I played with it during afterhours. Do you guys use it? Do you understand how it works in depth (how mo...

How do you model application states?

I'm writing a game, and I want to model its different states (the Game Maker analogy would be frames, I guess) in a clean, object-oriented way. Previously, I've done it in the following way: class Game { enum AppStates { APP_STARTING, APP_TITLE, APP_NEWGAME, APP_NEWLEVEL, APP_PLAYING, APP_PAUSED, APP_ENDE...

Web services that take and return XML documents - why?

Are there benefits of writing a web service interface whose methods all take and return XML documents, rather than the more usual parameter lists of native types and classes? We have some existing web services that are designed like this. The XML documents that are passed to their methods are typically large (as in they contain maybe 10...

Open-closed principle and Java "final" modifier.

The open-closed principle states that "Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification". However, Joshua Bloch in his famous book "Effective Java" gives the following advice: "Design and document for inheritance, or else prohibit it", and encourages programmers to use the "...

Relationship between URL and Filepath in a URL-rewriting scenario..

Experience tells me I shouldn't be storing a url in my database of media items. However that is what my architect is telling me. Surely it is the job of a front end server to map the filepath to a url? Any hints? What should I be considering with regard to URL rewriting? ...

How to find common strings among two very large files?

I have two very large files (and neither of them would fit in memory). Each file has one string (which doesn't have spaces in it and is either 99/100/101 characters long) on each line. Update: The strings are not in any sorted order. Update2: I am working with Java on Windows. Now I want to figure out the best way to find out all the s...

Static methods

I've just had an argument with someone I work with and it's really bugging me. If you have a class which just has methods like calculateRisk or/and calculatePrice, the class is immutable and has no member variables, should the methods be static so as not to have to create an instance of the class each time. I use the following example: ...

How do you apply Scrum to the design part of web development?

I'm starting to learn about Scrum, and I'm interested in trying it out with our development team. I have a lot of questions about it...but my biggest mental roadblock is in the actual graphical design. With our current development cycle [waterfall-esque], our graphical designer lays out the page with all the imagery and such based on a...

Why in C# does order matter for static initialization?

This code has the well defined behavior in C# of not working: class Foo { static List<int> to = new List<int>( from ); // from is still null static IEnumerable<int> from = Something(); } Note: I'm not asking how to fix that code as I already known how to do that What is the justification for this? C# already does run time che...

Choosing a Design Pattern

I need to design an application that resembles an internal mailing system. However, this is just a course project. No networking required. The professor is just making us put the discussed data structures to work. However, I have been having trouble deciding how to design the application. Let me explain briefly what I have to do and then...

What do you think is an example of a well structured n-tier .Net application?

In the search for resources to become a better developer, I am looking for good examples of how to structure the code in n-tier applications. Like... What does the business object do and look, how does it interface with the data access layer etc. How does the UI interface the business layer, and does it interface the DAL directly. Do ...

Why is the To property of .net's MailMessage class read-only?

I've got a MailAddressCollection that contains all the addresses I want to send an email to, but instead of being able to simply have: myMessage.To = myMailAddressCollection; I have to do: foreach (MailAddress address in myMailAddressCollection) { myMessage.To.Add(address); } Can anyone shed any light on why the class is ...

Websites like projecteuler.net

Sometimes I'm solving problems on projecteuler.net. Almost all problems are solvable with programs, but these tasks are more mathematical than programmatical. Maybe someone knows similar sites with: design tasks, architecture tasks, something like "find most elegant C++ solution"? ...

Would you store binary data in database or in file system?

This is a question which has been asked before (large-text-and-images-in-sql) but mainly for data which will be changed. In my case the data will be stored and never changed. Just seems sensible to keep everything together. Are there any reasons why I should not store static binary data in a database? Assuming it is a sensible thing t...

Refactoring of very combine code

I now have to refactor some code, it's basically one method(its around 1000 lines of code) that does a lot of calculations and have a lot of variables. I'm not sure how to refactor it. Does code like ... calculateSth(param1,param2,param3,param4,param5, params6); calculateSthElse(param1,param2,param3); ... look good? I could introduc...