473,503 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

is this possible in .NET?

Just a question to verify - I am a beginner in .Net

Our business needs require that we have to modify db tables on regular basis
(add column, remove column, add/drop table etc). Therefore it is a pain to
modify business logic layer+business data layer after you for example added a
column to a database. Additionally you have to recompile after every change
and bring a server down. Therefore is there a way to bypass re-compilation
process?

I am looking for possibility of making DYNAMIC (or Flexible) classes that
will grab information on tables structure, extract all column names, types,
column sizes and create objects with properties and CRUD methods to interfere
with database. Such flexible SQL will be generated on the fly by using those
classes/componets which will get input data and place it into paramertized
query. Additionally it should be cached on the client and/or on the server.
Nov 19 '05 #1
2 1153
It is certainly possible to write code that can interact with any type of
database, and any schema. How this is done depends quite a bit on the type
of database you're interacting with, and it is even possible to
programmatically determine that, if necessary. However, it seems to me that
you're overlooking something. Business objects are designed to work with
data, and to manipulate it.

For example, a "Person" class might have a "FirstName" property that is
linked via a database table to a column named "FirstName." Now, let's say
you added a column named "Foo" to the "Person" table in the database. Your
business class could certainly query the database to find the column, and
could even find out everything about that column in the database, what type
it is, how large it is, how it is indexed, etc. So, your business class
becomes aware that the column "Foo" now exists in the "Person" table in the
database. What does it do with it? It is, after all, a business class. It's
job is not simply to fetch data, but to work with it, manipulate it, use it
for something. So, what to do with "Foo?"

The database and the data layer know nothing about what "Foo" is. The data
layer is business-agnostic. It simply fetches and receives data, and hands
it off to be processed by somebody else. The database knows all about the
column, but nothing about what it represents. And of course, your interface
layer may be presented with this column. Of course, it may not. "Foo" may be
intended for use by the business layer only. But even if it is for the
presentation layer (which of course the business layer has no way of
knowing), and even gets handed off to it, what is the presentation layer
supposed to do with it? How should it be displayed? If it is in a form
(simplest possibility - it could be part of a graphic, after all), how
should the data be validated? Is it a string? If so, is it a phone number?
How should it be formatted? Is it a number? If so, how large or small should
it be?

An application is all about the data. The purpose of almost any application
is to enable a user to manage and/or use data in some form or fashion. Now,
if you're writing a database interface, like SQL Enterprise manager, which
is simply for the purpose of working directly with data AS data, and for no
other purpose, this sort of thing is useful. But data almost always
represents something. What it represents is anybody's guess. And how it is
handled depends upon what it represents, or what it is used for. And that is
what developers are for: To determine the requirements of the app, and how
the data used by the app should be handled.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"natzol" <na****@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
Just a question to verify - I am a beginner in .Net

Our business needs require that we have to modify db tables on regular
basis
(add column, remove column, add/drop table etc). Therefore it is a pain
to
modify business logic layer+business data layer after you for example
added a
column to a database. Additionally you have to recompile after every
change
and bring a server down. Therefore is there a way to bypass re-compilation
process?

I am looking for possibility of making DYNAMIC (or Flexible) classes that
will grab information on tables structure, extract all column names,
types,
column sizes and create objects with properties and CRUD methods to
interfere
with database. Such flexible SQL will be generated on the fly by using
those
classes/componets which will get input data and place it into paramertized
query. Additionally it should be cached on the client and/or on the
server.

Nov 19 '05 #2
It would be better to do it the other way around: rather than having code
that reacts to db changes, rather have an external data definition that code
then alters the database to agree with. The code can then also generate
appropriate sql to access the data.

..NET has fantastic reflection and dynamic capabilities, so having the data
definition in another format, say XML, you could create a code that turns
this into DDL and DML statements and also have dynamic table and column
classes that are dynamically created and fed the metadata to perform
advanced funtions.

We have been doing this for years with great success.

Good luck,

Radek

"natzol" <na****@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
Just a question to verify - I am a beginner in .Net

Our business needs require that we have to modify db tables on regular
basis
(add column, remove column, add/drop table etc). Therefore it is a pain
to
modify business logic layer+business data layer after you for example
added a
column to a database. Additionally you have to recompile after every
change
and bring a server down. Therefore is there a way to bypass re-compilation
process?

I am looking for possibility of making DYNAMIC (or Flexible) classes that
will grab information on tables structure, extract all column names,
types,
column sizes and create objects with properties and CRUD methods to
interfere
with database. Such flexible SQL will be generated on the fly by using
those
classes/componets which will get input data and place it into paramertized
query. Additionally it should be cached on the client and/or on the
server.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
14460
by: Julia Briggs | last post by:
I am struggling to create a PHP function that would take a specified image (JPG, GIF or PNG) from a link, and resize it down to a thumbnail so it will always fit in a 200x250 space. I am hoping...
36
9431
by: rbt | last post by:
Say I have a list that has 3 letters in it: I want to print all the possible 4 digit combinations of those 3 letters: 4^3 = 64 aaaa
20
2436
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
7
2335
by: Andrzej | last post by:
Is it possible to call a function which name is given by a string? Let assume that I created a program which call some functions for example void f1(void), void f2(void), void f3(void). ...
2
3783
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens...
1
6941
by: AAA | last post by:
hi, I'll explain fastly the program that i'm doing.. the computer asks me to enter the cardinal of a set X ( called "dimX" type integer)where X is a table of one dimension and then to fill it...
25
2517
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e....
4
7642
by: RSH | last post by:
Okay my math skills aren't waht they used to be... With that being said what Im trying to do is create a matrix that given x number of columns, and y number of possible values i want to generate...
7
3346
by: Robert S. | last post by:
Searching some time now for documents on this but still did not find anything about it: Is it possible to replace the entry screen of MS Office Access 2007 - that one presenting that default...
14
1986
by: bjorklund.emil | last post by:
Hello pythonistas. I'm a newbie to pretty much both programming and Python. I have a task that involves writing a test script for every possible combination of preference settings for a software...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.