design

Design question about SPSecurity.RunWithElevatedPriviledges in multi-tiered design

I have a question re: performance and design. Crux of the problem is: do I wrap RunWithElevatedPriviledges around a sequence of methods all requiring its use (but the call is in the wrong layer), do I call it each time in the appropriate later. I am refactoring code that initially had 2 layers (front-end & database). I've now split thi...

C++ singleton design: using inheritance to call only some implemented methods

I have a singleton that is the main engine container for my game. I have several abstract classes that make the developer implement the different calls to what that specific object needs. What I want to do is to make my singleton call those methods upon each given object, but avoiding unecessary calls. Example so you can understand bet...

Share & Embed Widget design samples?

I am searching for some sample interface or design for creating a "Share & Embed Widget or Link" interface in my website. I found scribd.com's interface interesting http://www.scribd.com/doc/22735617/Senate-Health-Care-Bill here click on "Share & Embed" link given in top-right of the doc. Could any one please provide me some sample li...

Design question - how atomic should a business layer method be?

This issue is technology agnostic, but I am working with C# and ASP.NET and will use this for the pseudo code. Which is the better approach, and why? Encapsulate logging, transaction and exception handling: protected void Page_Load(object sender, EventArgs e) { SomeBusinessClass.SomeBusinessMethod(); } public class SomeBusinessClas...

Exceptions, return values, and contextual information

I know that this type of question has been asked over and over again, however, I have yet to find a definitive answer for the problem I am looking into. From all the content on exception handling that I have read it appears that the general concensus is that exceptions should only be used for exceptional circumstances. I've also read i...

Java POI HSSF Memory Handling Question

I have a design question on how to design parsing a large excel file say 1000 x 100 Rows, and about 10 tabs. Each Tab having a set of records with primary key as the first col. but these could be repeted in different tabs and each does not have the same set of primary keys. Read a single primary key and form a java object with all the...

How to develop a site that allow user to upload his own script as demo?

Including PHP/html/js/css and so on. The difficult thing is how to avoid the hackers uploading destructive scripts? Is it just possible? ...

Ask the user or try not to bother him?

I have an application that might receive a net request for data from another computer. The data can be grouped into several categories so that filtering can be made upon it. In this situation two things can happen: I give the user the ability to filter the information he wants to send (thus reducing bandwidth and providing the user wi...

Patterns used in WPF

I have been getting more involved with WPF for about a year now. A lot of things are new and sometimes it is hard to get my head wrapped around it. At the same time I am rereading the GOF Design Patterns book. A few times I would stop in the middle because I would realize that a certain pattern is the very one used in some WPF functio...

Making a generic MovableGameEntity Class for my 2D game?

Hello, I have come to a point in my 2D game ( I'm writing the whole engine myself for learning purposes ), where I need to create some kind of class that Inherits from my GameEntity class that will contain Entities that actually move somehow in my game. For example, that class ( MovableGameEntity ) could contain an enemy, so it would ha...

How do you make a good web site design

What resources do you use to make a good and beautiful web site design? Do you use templates? What patterns you use? Are there any web site with good resources and ideas? ...

When does template instantiation bloat matter in practice?

It seems that in C++ and D, languages which are statically compiled and in which template metaprogramming is a popular technique, there is a decent amount of concern about template instantiation bloat. It seems to me like mostly a theoretical concern, except on very resource-constrained embedded systems. Outside of the embedded space,...

Patterns/Practices for designing Web Services

Are there any good patterns/practices used while designing Services. I came across this post today: http://stackoverflow.com/questions/1549743/when-to-use-the-decorator-pattern/1549771#1549771 Though I didn't completely understand but it really gives a new direction to think about designing services. Note: This question is not any tec...

Row separator in datalist

I'm using a datalist control. How I can add a row separator in the datalist? I have more than one item in a row and I'm using .Net 2.0. Separator template work for each item not for each row. I want to display it like this. row1-> item1 item2 ---separator row2-> item3 item4 ---separator row3-> item5 item6 ...

Reading code of real production projects. How to find?

I really like the idea of reading others people code to improve your design skills. Open source can help here a lot. This can teach you basic OO principles. But I'm not writing frameworks, I'm writing code for real customers with quite complicated domain logic. There are lots of manuals of different MVC frameworks(like Create a blog wi...

MVC design question

I'm developing basic GUI application. I have model class which counts time, I need to display this time to label in specific format. What is the right way to do it in according to MVC paradigm ? Logically I think it should be formatted in the view, but view is standard label control and implementing sub-label class seems a little bit ove...

c# Is their a normal or established way to workflow methods with a class.

Hi, I'm investigating a possible design. Is their a way or established mechanism, or pattern, to select a set of arbitary methods to excute depending on some input. For example, if you were trying to implement a lexer, and you didn't want to go so far as implementing using lex, or even going a far as implementing an LL(1) or LR(k) pars...

How should I handle Inconsistent Objects in C++?

Say, I want to create a File class class File{ public: File(const char *file){ openFile(file); } ~File(); isEmpty(); }; openFile checks if the file exists or if the contents of the file are valid or not. File *file = new File("filepath"); if(file) file->isEmpty(); if my fil...

Better looking PDF bookmarks

Hi there, Does anybody know if I can improve the visual appearance of bookmarks in a PDF. My marketing dept wants me to make them look more "webby" - by which they mean they want them to look more "designed" rather than plain text links. Cheers, Stan ...

Overlay 2d weapon sprite over character sprite ?

Hello, I'm working on a game where my character needs to be able to have different weapons. For that I think that somehow overlaying the weapon over the moving sprite would be the correct choice, but I'm not sure about how could I do this. Assuming my Character spritesheet looks like this: And my preliminar weapon spritesheet ( haven...