Saturday, November 2, 2013

Transactions and ACID Principle

http://blogs.curtin.edu.au/webdev/2010/05/09/nested-cf-transaction-blocks/ - article gives good use case for nested transactions: insert user, then add-or-update content items which are associated to the new user.

Saturday, September 28, 2013

Saturday, September 14, 2013

Single Responsibility Principle


The rational behind the exact example that you gave is that if each class has a save method, then if you later change how you are saving data (from say filesystem to database or remote XML file) then you have to change every class. If each class implements an interface to yield that data that it wants saved, then you can write one function to save instances of every class and only change that function once. This is known as the Single Responsibility Principle: Each class should have only one reason to change.
http://stackoverflow.com/questions/3498200/organising-classes-and-modules-in-python

Singletons vs. Modules

A module is the language level implementation of a singleton without the need to prepend self to every methods argument list.
http://stackoverflow.com/questions/3498200/organising-classes-and-modules-in-python

Sunday, September 8, 2013

Allowing Nulls in R-tables

According to Codd a "table with at least one nullable attribute" (Wikipedia) disqualifies it from being 1NF. http://en.wikipedia.org/wiki/First_normal_form

But while the NULLs do not violate 1NF, they do violate the core relational Information Principle (IP), which requires data to be represented in exactly one way--as values in R-tables.

Saturday, August 10, 2013

Third Normal Form

We’ve created functional dependencies between nonkey columns, violating the third normal form. Basically, the value of Discriminator column determines the corresponding values of the columns that belong to the subclasses (e.g. BankName) but Discriminator is not part of the primary key for the table.
http://weblogs.asp.net/manavi/archive/2010/12/24/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-1-table-per-hierarchy-tph.aspx

POCO - Defined

EF Code First enables you to use “POCO” – Plain Old CLR Objects – to represent entities within a database. This means that you do not need to derive model classes from a base class, nor implement any interfaces or data persistence attributes on them. This enables the model classes to be kept clean, easily testable, and “persistence ignorant”.
http://weblogs.asp.net/scottgu/archive/2010/12/08/announcing-entity-framework-code-first-ctp5-release.aspx

Saturday, July 13, 2013

Rule Triggers

Example of a "rule trigger" (which I believe muddies code when placed inline, which is why we need standard rules engines?)

Being a member of "Halloween Sale" does not mean that the item is always on sale. The "rule trigger" should also take into account the date. Example:
  HALLOWEEN = 18   // See example tables above
  if memberOf(item,HALLOWEEN) and month(today()) = "October" then
    item.price = item.price * 0.9
  end if
http://www.geocities.com/tablizer/sets1.htm

Tuesday, July 9, 2013

Software Requirements

Requirements gathering -- Collecting user, operational, and platform requirements. User requirements express who the business users are and what they need to do with the system. Operational requirements address the system and network management and maintenance. Platform requirements detail the desired infrastructure components.
Note: So there's more counted as "requirements" than just user requests...
link

Sunday, June 30, 2013

Web Development Process

"Scripting elements that are used to prototype solutions should migrate into tag libraries as part of the development process" -- on JSP scripting elements versus tag libraries. link

Wednesday, June 12, 2013

Denormalization

On the fallacy of it: http://www.dbdebunk.com/2013/03/normal-forms-dependent-on-dependencies.html
Shows the need to recognize Functional Dependencies even in time-based records such as invoices.

Tuesday, June 11, 2013

First Normal Form


The classic discussion point is "OK, so you have phone1, phone2 and phone3, so what happens if one customer has 4 phones?". If your design is vulnerable to such a point then it is not in 1NF. – Greenstone Walker May 6 at 1:52

Wednesday, May 8, 2013

Where to Handle ASP.NET Exceptions

Unless some special exception is expected, you wouldn't want to handle general exceptions in the page code. Exception handling belongs in Global.asax
 http://www.codeproject.com/Articles/241066/How-to-Validate-ASP-NET-Web-Forms-Using-Business-R

Friday, April 26, 2013

Java Logging

Don’t forget to include Thread Name and fully qualified java class Name while printing logs because it would be impossible to find sequence of events if your code is executed by multiple threads without having thread name on it.
http://javarevisited.blogspot.com/2011/05/top-10-tips-on-logging-in-java.html

Monday, April 22, 2013

Java Servlets


The servlet container can be running in the same process as the host Web server,
in a different process on the same host, or on a different host from the Web server
for which it processes requests.
https://java.net/downloads/servlet-spec/Final/servlet-3_1-final.pdf

Friday, April 19, 2013

URL Parts in REST Service


http://localhost:8080/restful/resources/helloworld... it’s good to take a look how the URL is composed because when we start creating the service, you will see how the various parts of the URL—namely, the context root restful, the mapping of the RESTful resource container resources, and the name of the service itself—all manifest themselves in either the code or the XML configuration files.

http://www.theserverside.com/tip/RESTful-Web-services-made-easy

Saturday, April 13, 2013

DAO vs. Active Record

The DAO pattern is a popular choice in term of implementing of Data Access Layer. There is another pattern start to be attractive to developers especially inside some Dynamic Programming languages -- The Active Record pattern. The basic idea is directly enhancing the Domain Object to do data persistence. Recommended to read more before making decision which one is better for your project.
http://www.linkedin.com/groups/EJB-entity-beans-Hibernate-dao-50472.S.120316355

EJB's

EJB's are heavy weight components with all the different contract/convention. EJB entity beans provides you persistence with CMP and BMP with CMPs the container is taking care of all the services (Transaction, Security, Concurrency) and in BMP the bean itself needs to manage the services.
http://www.linkedin.com/groups/EJB-entity-beans-Hibernate-dao-50472.S.120316355

BPM

As a managerial approach, BPM sees processes as strategic assets of an organization that must be understood, managed, and improved to deliver value-added products and services to clients. 
http://en.wikipedia.org/wiki/Business_process_management

DTOs

Nor are ADO.NET data sets truly suitable as data transfer objects (the objects I shove around via messaging).
http://humbleblogger.blogspot.com/2005/04/aspnet-vs-j2ee.html

Saturday, March 30, 2013

Git: Getting Started

Lots of good discussion on this over at SPServices.

On the .js build process ptavares:

  • Generate developer jsDocs (javadoc type of stuff)
  • Generate user documentation (I used to do it with NaturalDocs, I now use Markdown)...
  • Create minified version of library file(s)
  • Create a distribution package (zip file with source, documentation and minified versions) 

Thursday, March 28, 2013

Class-based vs. Prototype-based

Apparently being class-based improves performance. Re: ActionScript: Improved performance from a class-based inheritance system separate from the prototype-based inheritance system. http://en.wikipedia.org/wiki/ActionScript What does that say about Javascript as a competitor to RIA apps?

Wednesday, February 27, 2013

SPWebConfigModification Research

There's conflicting advise on how to use this feature. My take is not to use clear() and if you go this route, make sure all web.config entries are done using SPWebConfigModification (or else, e.g. if you hand jam entries manually you risk having those changes overwritten).

Note on EnsureSection: at first I thought it was a good idea, but found it only applies to full elements (will not ensure/create e.g. a particular sectionGroup because it requires attributes.

refs:
http://blog.crsw.com/2007/09/20/how-to-modify-the-web-config-file-in-sharepoint-using-spwebconfigmodification/
http://msdn.microsoft.com/en-us/library/ms467128(v=office.12).aspx
http://blogs.devhorizon.com/reza/2008/01/05/spwebconfigmodifications-top-6-issues/
http://msdn.microsoft.com/en-us/library/ff707273(v=office.12).aspx
http://bpetluri.blogspot.com/2010/08/sharepoint-changing-webconfig-for-one.html
http://web.archive.org/web/20081014210148/http://blog.thekid.me.uk/archive/2007/03/20/removing-web-config-entries-from-sharepoint-using-spwebconfigmodification.aspx
http://www.codeproject.com/Articles/45314/SPWebConfigModification-Tool-and-Explorations - shows examples on EnsureSection usage
http://translate.google.com/translate?hl=en&sl=de&u=http://blogs.myfirstsharepoint.de/technikblog/aus-der-praxis-konflikte-zwischen-spwebconfigmodifications-vermeiden&prev=/search%3Fq%3D%2522applicationSettings%2522%2BSPWebConfigModification%26hl%3Den%26biw%3D1172%26bih%3D737&sa=X&ei=8_ssUZPDBO7h0wHWrICADw&ved=0CGcQ7gEwCA - This indicates (and I confirmed through tests) that ensuring a child will not overwrite existing children that don't match.
http://sharepoint.stackexchange.com/questions/306/cant-remove-web-config-entries-with-spwebconfigurationmodification - example
http://oricode.wordpress.com/2008/03/05/spwebconfigmodification-configure-applicationsettings-with-a-feature/ - left comment here

Saturday, February 16, 2013