theory

Can good Object Orientated Design be formalised as good relational database design has been?

荒凉一梦 提交于 2019-12-01 06:30:22
In the database world, we have normalisation. You can start with a design, crank the steps and end up with a normal form of the database. This is done on the basis of the semantics of the data and can be thought of as a series of design refactorings. In object orientated design, we have the SOLID principals and various other adhoc guidelines towards good design. Do you think it is possible to define the equivalent of normal forms for OO, such that a series of refactoring steps could move a procedural piece of code (or poorly factored OO design) into a correct (in some well-defined sense)

Good Namespace Naming Conventions

有些话、适合烂在心里 提交于 2019-12-01 06:16:14
问题 I am creating a class library for a CRUD business application. The major "categories" of business objects (with related data access layer objects) are: Maintenance (for working with master tables (master lists) in the database Incidents (most objects relate to a real-world incident) Search (obvious) As of now, my namespaces are set up as follows: BusinessObjects.Maintenance.Contacts BusinessObjects.Maintenance.Products BusinessObjects.Maintenance.Classifications . BusinessObjects.Incidents

Basics in Universal Hashing, how to ensure accessibility

痴心易碎 提交于 2019-12-01 04:11:15
问题 to my current understanding Universal Hashing is a method whereby the hash function is chosen randomly at runtime in order to guarantee reasonable performance for any kind of input. I understand we may do this in order to prevent manipulation by somebody choosing malicious input deliberately (a possibility of a deterministic hash function is know). My Question is the following: Is it not true, that we still need to guarantee that a key will be mapped to the same address every time we hash it

What is the difference between a subroutine and a function? [duplicate]

自闭症网瘾萝莉.ら 提交于 2019-12-01 03:12:11
Possible Duplicate: What is the difference between a ‘function’ and a ‘procedure’? I searched online for an answer to this question, and the answer I got was that a function can return a value, modify a value, etc., but a subroutine cannot. But I am not satisfied with this explanation and it seems to me that the difference ought to be more than just a matter of terminology. So I am looking for a more conceptual answer to the question. A function mirrors the mathematical definition of a function, which is a mapping from 1 or more inputs to a value. 1 A subroutine is a general-purpose term for

? operator without else-part

久未见 提交于 2019-12-01 02:30:40
I use C# ? operator when I have if-statements that affects one row and it's all good. But lets say I have this code (using classic if-statements): if(someStatement) { someBool = true; //someBools value is unknown } else { //Do nothing } This can be achieved on a one-liner by doing: someBool = (someStatement) ? true : someBool; But why can't I do something like this: someBool = (someStatement) ? true : ; //or possibly someBool = (someStatement) ? true; Is this possible in some way? If it is, is there any benefits of using one method over the other? And if not, why shouldn't you be able to do it

Algorithm: for G = (V,E), how to determine if the set of edges(e belong to E) is a valid cut set of a graph

谁都会走 提交于 2019-12-01 01:46:42
Given a subset of edges of a graph G = (V,E), how can we check whether it is a valid cut-set of the graph or not? Note: A cut is a partition of the vertices of a graph into two disjoint subsets. So, cut-set of the cut is the set of edges whose end points are in different subsets of the partition. I am interested to find an algorithm for this problem A simple algorithm would be to remove the suspected cut-edges from the graph, and see if you can still get from a node of a removed edge to its counterpart. If you still can, it was not a full cut. So if you remove E2 which had nodes A and D, you

Context Free Language Question (Pumping Lemma)

风格不统一 提交于 2019-12-01 00:57:00
问题 I know this isn't directly related to programming, but I was wondering if anyone know how to apply the pumping lemma to the following proof: Show that L={(a^n)(b^n)(c^m) : n!=m} is not a context free language I'm pretty confident with applying pumping lemmas, but this one is really irking me. What do you think? 回答1: Edit: I was totally leading you down the wrong track. That's what happens when I try to help out when I haven't completely solved the problem myself. Ogden's Lemma Suppose L is

What is the difference between a subroutine and a function? [duplicate]

白昼怎懂夜的黑 提交于 2019-12-01 00:14:09
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: What is the difference between a ‘function’ and a ‘procedure’? I searched online for an answer to this question, and the answer I got was that a function can return a value, modify a value, etc., but a subroutine cannot. But I am not satisfied with this explanation and it seems to me that the difference ought to be more than just a matter of terminology. So I am looking for a more conceptual answer to the

? operator without else-part

筅森魡賤 提交于 2019-11-30 22:55:46
问题 I use C# ? operator when I have if-statements that affects one row and it's all good. But lets say I have this code (using classic if-statements): if(someStatement) { someBool = true; //someBools value is unknown } else { //Do nothing } This can be achieved on a one-liner by doing: someBool = (someStatement) ? true : someBool; But why can't I do something like this: someBool = (someStatement) ? true : ; //or possibly someBool = (someStatement) ? true; Is this possible in some way? If it is,

(De)Normalization of two relations

一世执手 提交于 2019-11-30 13:34:50
People who read C.J.Date's Introduction to Database System or books of similar level should not have problems with definition of normalization and denormalization. However, memory is not what it used to be and I find myself often looking at some design and saying that it is not normalized even though I can not find which of the normal forms it is breaking. The actual example that illustrate it is: If we have relations r1 (A, B, C) and r2 (A, D) with FDs: AB->C and A->D and r1 represent detailed data, while r2 is summary of that data (in another words each instance of D is a function of values