P
Phillip Ian
Just a quick architecture question. I'm just looking for discussion,
not a flame war, please.
In the past, I've tended to use a public module for my data layer
functions. Something like:
public module db
Friend ConnectionString As String = ""
Public Sub InitializeDB(ByVal AConnectionString As String)
ConnectionString = AConnectionString
End Sub
public function GetUserRecord(AnID as integer) as cUser
...
end function
public function GetUserList as cUserList
...
end function
end module
Now, with the new object data source, it looks to me like the framework
is expecting a class, not a module.
public class db
public shared function GetUserRecord(AnID as integer) as cUser
...
end function
public shared function GetUserList as cUserList
...
end function
end class
That's fine, I can live with it. I'm just curious why the requirement
that the data access functions be methods instead of just functions.
I'm also assuming that the preferred way of handling the connection
string would be in the ConnectionStrings element of the app.config
file?
Anyway, hopefully someone can tell me if I'm heading down the wrong
path here, before I go changing my whole methodology.
not a flame war, please.
In the past, I've tended to use a public module for my data layer
functions. Something like:
public module db
Friend ConnectionString As String = ""
Public Sub InitializeDB(ByVal AConnectionString As String)
ConnectionString = AConnectionString
End Sub
public function GetUserRecord(AnID as integer) as cUser
...
end function
public function GetUserList as cUserList
...
end function
end module
Now, with the new object data source, it looks to me like the framework
is expecting a class, not a module.
public class db
public shared function GetUserRecord(AnID as integer) as cUser
...
end function
public shared function GetUserList as cUserList
...
end function
end class
That's fine, I can live with it. I'm just curious why the requirement
that the data access functions be methods instead of just functions.
I'm also assuming that the preferred way of handling the connection
string would be in the ConnectionStrings element of the app.config
file?
Anyway, hopefully someone can tell me if I'm heading down the wrong
path here, before I go changing my whole methodology.