473,657 Members | 2,456 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 1162
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
programmaticall y 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****@discuss ions.microsoft. com> wrote in message
news:80******** *************** ***********@mic rosoft.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****@discuss ions.microsoft. com> wrote in message
news:80******** *************** ***********@mic rosoft.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
14468
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 not to have it inserted or read from a database to do this function. Can it be done & someone please help me?
36
9458
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
2478
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 the site, and then i have to select the file to upload.. i used sendkeys.. and i worked perfect.. BUT ... the computer must be locked for security ( obviusly ) reazons.. so..i think this probable solutions to unlock the computer and run the...
7
2346
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). After some time, I added new function void f4(void).
2
3802
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 provide text area where the user can insert big chunks of text and submit it all to the server paragraph by paragraph. The requirement is to do a Spell Check AND Grammar Check in the text area. I did look at lot of possible third
1
6952
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 with numbers X; then the computer asks me how many subsets i have (nb_subset type (integer)) then,i have to enter for every sebset the card, and then to fill it, we'll have a two tables , one called cardY which contains nb_subset elements,and every...
25
2536
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. every 5 seconds, i just want to refresh it ONLY on server change just like desktop applications do. The problem is that refreshing evry n seconds has to much impact on my web server. The refresh action should be taken only when something
4
7673
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 a two dimensional array of all possible combinations of values. A simple example: 2 - columns and 2 possible values would generate: 0 0
7
3353
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 'templates' (with that big graphic buttons) - with some sort of own HTML-Page? I could imagine, that somehow it is possible to change this construction (hopefully not hardcoded in MS-Acc07), like it is possible to edit the 'Fluent Ribbon'? If so...
14
1997
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 I'm testing. I figured that this was something that a script could probably do pretty easily, given all the various possibilites. I started creating a dictionary of all the settings, where each key has a value that is a list of the possible...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8603
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
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 we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.