design

Returning data from the business layer to the presentation layer

I am developing an ASP.NET 2.0 website. I have created data access and business logic layers. Now in the presentation layer I am returning data from the business layer as a dataset. My question is whether to use a dataset or object collection (for example a Category object representing the Category table in my database). I have defined ...

Splitting up a class into sub-classes

I've got a business logic layer class containing access methods for each table in a database. As there are quite a few tables now I'd like to restructure it to group the methods by entity (for easier access when coding). So, from this: BLL.Database MyDB = new BLL.Database(); BLL.Entity.User MyUser = Database.UserGetById(42); to this: ...

C#: Instantiate an object with a runtime-determined type

I'm in a situation where I'd like to instantiate an object of a type that will be determined at runtime. I also need to perform an explicit cast to that type. Something like: static void castTest(myEnum val) { //Call a native function that returns a pointer to a structure IntPtr = someNativeFunction(..params..); //determi...

Techniques for removing old data on Oracle databases

We have a mature Oracle database application (in production for over 10 years), and during that time, we have been using scripts of our own devising to remove old data that is no longer needed. They work by issuing delete statements against the appropriate tables, in a loop with frequent commits, in order to avoid overloading the system...

How to Show Aggregation in terms of A Programming Code ?

Hi, I know about Association and Aggregation and Composition and Generalization what they are by definition. inheritance is "is a" relationship and composition is "has a" relationship. Class A { } Class B extends A { // this is Generalization } Class C { A ob; // this is composition } now my question is how the Aggregation and si...

Large application design (WPF/Silverlight)

Aside from the MVVM, as well as MVC patterns for the overall structure of a WPF app, how exactly do you break up the model/controller aspect of an app into subcomponents? The reason I ask is that I have no problem architecting the solution from the perspective of the patterns mentioned above, but when it comes to actually writing the ba...

LINQ Design and Prototyping

I'm about to start my first LINQ (to Entities) 'enabled' project, and it immediately strikes me how easy it is to draft SQL queries in SQL Server vs. writing and running code to check results. What do people usually do here? Prototype in T-SQL then implement in code, or use a tool, or what? ...

IE space below image?

How can I fix this page for Internet Explorer? It seems to add a space below the background images for some reason.. http://orangeguy.biz/profile/ The design is like this: ------------------ | TOP IMAGE |<- base_top.png ------------------ | | | | base_...

Haskell type vs. newtype with respect to type safety

I know newtype is more often compared to data in Haskell, but I'm posing this comparison from more of a design point-of-view than as a technical problem. In imperitive/OO languages, there is the anti-pattern "primitive obsession", where the prolific use of primitive types reduces the type-safety of a program and introduces accidentally ...

How to assemble a project with software products and your own code

Hello, Let's say you have a specific project on hand, it can be divided to parts, and you are not completely sure about all the difficulties that will arise. Time is of the essence. How do you decide whether a part should use software product or your own code? (considering, that some tools are awesome, but will require much time to lea...

Alternatives To The Treeview

In my opinion treeviews are overused, therefor I don't really care for them. Sometimes they're necessary but I can imaging that one could always find a good alternative to the standard treeview. What are some other innovative ways to display hierarchical information that convey the same information without the drab of a treeview? Which ...

Ugly user interfaces

I have seen numerous ads/sites poking fun of a cluttered user interface by setting it up side by side with, say, Google and having a caption like: this is your site / this is theirs. That’s all very funny, but actually, Google only needs a textbox and a submit button. What about when your page is a data entry form, say an order entry ...

Advice on wrapping third party libraries

I have been working a year now as a software developer for a at the computer-vision department of a company. My main job is integration of third-party software into a framework, so i usually end up writing wrapper libraries because a lot of this third party software does not work the way we want it to work(not thread safe, pain in the a*...

Law of Demeter doesn't make sense in my case

Looking on this answer I understand that you should not copy private pointers using friendship in C++ like I did in my program: class bar; class foo { private: some_smart_pointer<int> state; public: foo(int value) : state(new int(value)) {} friend class baz; }; class bar { private: some_weak_pointer<int> state; public: ...

How big should your WPF app be to start using MVVM

Recently there have been a lot of move towards MVVM framework due to the nature of WPF development. I am making a pretty small application, which might grow a little over time. I am curious to know, what sized application should benefit from a MVVM implementation. For example .. has to have 15 user screens to be beneficial or something l...

How do I get WYSIWYG design in Blend/VS without merged ResourceDictionary in every XAML file?

I've just removed a big memory issue for me, I used to merge our "Themes" resource dictionary in every xaml file instead of just in the app.cs.xaml. However, after removing the merging in every file except the App.cs.xaml I've lost the design time styles/templates. Please note: This only applies to the styles merged into our Themes.xam...

Code reuse and refactoring

What's best practice for reuse of code versus copy/paste? The problem with reuse can be that changing the reused code will affect many other pieces of functionality. This is good & bad : good if the change is a bugfix or useful enhancement. Bad if other reusing code unexpectedly becomes broken because it relied on the old version (or t...

Icons vs Text for Commonly Used Actions

We are currently trying to improve our usability in our intranet web app. One of our goals is to declutter certain pages which have large Grids on them. To do this, we have started putting commonly used actions (like Delete, Reset To Zero, Mark As Complete, etc.) in the grids as functions. My initial idea was to find and use icons (...

why don't html form elements obey my CSS?

I am trying to make form elements fit into a visual style with other DOM elements including making buttons and text-inputs fit together, buttons and divs as a single visual element (like a form button attached to some content div with the same background color). Why don't form elements follow the same rules as other DOM elements? they s...

When to switch from SQLite to MySQL in production?

I am developing a web application in Django. My application is already up, and some users are are using it (say about 5-10). The database is SQLite. Should I move to MySQL now? Or, wait till the user base increases? I don't have any user registration feature, yet. The basic usage of app is - problems are served n users solve them. ...