[thelist] RE: How does "Box-in-a-box" hack work?

Joshua Olson joshua at waetech.com
Thu Jul 15 15:55:05 CDT 2004


> From: Maximillian Schwanekamp
> Sent: Thursday, July 15, 2004 3:23 PM
> To: thelist at lists.evolt.org
> Subject: RE: [thelist] RE: How does "Box-in-a-box" hack work?
>
>
> >On the other hand, I'm sure there are benefits to the "correct" box model
> >that are not so obvious.  Sooo....
>
> I guess the thing that led the W3C folks "astray" on the box model is the
> centrality of content - the correct box model uses content as its point of
> reference, not the box into which said content is being
> presented.  My .02.

Maximillian,

That is in intriguing observation--and one that provoked some though.  Do
consider that the only reason for boxes is for layout and presentation.  If
the point of the web was only content, then you wouldn't be able to style
boxes... and dare I say everything would be plain-jane XML.

In other words, content really has nothing to do with "boxes".  So, the only
remaining reason to have boxes is to provide layout for the given content.
Given that, modeling the boxes after the content within them doesn't make as
much sense.  Indeed, it would make more sense to model boxes after their
relationship with other boxes!

<tip type="SQL Server" author="Joshua Olson">
If you use a date field to indicate the date the record was deleted and
filter on that (as opposed to actually deleting anything), then you may want
to protect against use of DELETE to delete records.  You can do this one of
a few ways... you can force access to the table through stored procedures,
remove delete rights from the table for the user, or a third method, which
is my favorite--

Create a INSTEAD OF trigger on DELETE.  Example:

CREATE TRIGGER payment_delete ON dbo.payment
INSTEAD OF DELETE
AS
  DECLARE @id int

  SELECT @id = id FROM deleted

  UPDATE payment
  SET date_deleted = GetDate()
  WHERE id = @id

This way, even if a DELETE query is executed, the record will only be marked
as deleted instead of actually deleted.
</tip>

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168




More information about the thelist mailing list