Architecture :: Best To Make Classes In VB, VB.NET OR C#?
Nov 29, 2010
1. Desktop based application - Developed in VB2. Web based application - Developed in Asp.Net 2.0 and C#The above two uses same database in SQLI do have proper class library/business logic in desktop based application in VB. Now I need to use the same library in ASP.net web based application so that I can change at one place and both the versions will work fine with replacement of one dll.hat is the best to make classes in VB, VB.NET OR C# so that I can use at both end easily.1. If I write Activex dll in vb, the internet articles tells about low performance because of Interop services.
I'm implementing n-tier structure in the current app I'm working on. Because DataBinding a list of my Objects to a Repeater was far too slow I need to databind a DataTable to the Repeater. Should I still DataBind to a Function (that returns a DataTable) in the BLL that calls a Function in the DAL that returns a DataTable?
I have a third party dll and i need to add some more functionalities (methods, constants etc..) so create a wrapper class. I have no idea about wrapper classes. what is the purpose of this and how to create in .NET for this 3rd party dll.
I got loads of website, that share one of two baseclasses. I need the two baseclasses to be able to share part of the same code. I dont want to have to duplicate the shared code per baseclass.
so.. I got a page.aspx that inherits the baseclass and that inhertis 'sub' baseclass that inherits the web.ui.page class. So far so good :-)
In my baseclass I got a Public (at the top of the class not in any method- not sure of the proper term) Varable that is constructed from a structure in the BO class.
it Public PageDetails AS CoreDomainSetupBO.GetStartUpDetails = {database method}
I need the pagedetails to be available in the sub baseclass but it cant be defined there as the page details value is defined differently in the different base classes.
I hope that makes sense, I need to sub base class to be able to use a property that is defined at baseclass level.
I am looking for general direction on the best practice here. I have a class that I want to share between two different forms in two projects that are associated. The two forms are in seperate projects but both projects load together as I have added the second project to the first. I also have a class that I want to share between these two projects which will cause me to add another project to this solution with will mean I will have three projects in my solution. My question is how do I best share this class?
I believe the only way to do this is to add the class in the reference in both of the form projects?... Is this correct ? I'd really like to just reference the class and inherit it in the source code without adding it as a reference but I am feeling that I can't do that. I am obviously pressed for time and working on other projects and a I am a experienced coder with only about 1 year of C# experience...
I am searching for what are the standard best practice (for OOP) used to design classes for develop asp.net application? I am aware of most of the OOP concepts but confused with how to map object/classes.
Let's take example of Adventure works - 2005 database provided by Microsoft; it has five schemas Sales, Purchase, Person, Production, HR and DBO.
Should we consider Schemas as Namespace in Classes?
Now, Person schema has 5 tables, should we design classes based on tables?
i.e. Person schema has Address, AddressType, Contact, ContactType, CountryRegion & StateProvince tables. What are the classes we can consider?
What are the basic criteria to decide objects? What to do and how to design classes for tables like Purchase order detail, Product cost history, Product inventory, Product Category etc.
I am updating a project I wrote some time ago. At the time my preference was for DataSets and DataSetTableAdapters, but I've now moved on to use Linq to SQL DataClasses. I would like to convert the project to Linq to SQL, but I am tight on time and it's a big job. My question is, is there any reasons I can't develop new modules using Linq to SQL DataClasses along side DataSets and convert the DataSets overtime?
Apart from the obvious confusion it will cause, are there any technical problems I should be aware of i.e. will there be any performance problems using the two methods?
Can we use membership class in 3 tier architecture? Actually i want to use ASP.NEt's login control and membership for authentication. Can it will be possible in 3 tier using membership.
I was wondering if you should write code so that external classes and functions of that external class can access the webform controls in the main class???
Or should you only use the external class to process some data, return that data back to the main class (that instantiated that external class object) and then have an internal function in the main class to deliver the data to the control? (back to the screen)
where to create the BLL and DAL and all classes in it can we place them in the App_code folder as it ll convert them into DLL Files or do we have to create a new class library project for each...
My MVC ASP.NET web application is split up like this:
Web Application Layer Views
[Code]....
Now, I have a view in the database called "EquipmentWithCableDetails", which contains additional useful information with the equipment details - so I create a class to model that view (in order to be able to read from it). In the code I have that works with that new class, I want to display the EquipmentDescription - but that property only exists on the Equipment class.
I am using the ADO.NET Entity Framework for loading data from the database. The classes are directly mapped to database tables in the database. The problem is that these classes are not optimal for binding to the UI elements. As a result of this I have some custom entities which are populated at the service layer and returned. It is these custom entities (classes) to which I bind the UI elements. My questions on this are1. Is populating these entities at the service layer the most appropriate way to do this. I personally do not think so because if we introduce some additional UI elements which need different entities then I have to modify the service layer again.2. What is the best approach/pattern to get this done.
So I started working on my first asp.net application that involves logging in and databases, and soon after i started messing around with a static class. I "discovered" that if you make a variable static, all sessions share that variable (I for some reason was originally assuming that each session had its own copy of that "static" class). Anyway, after discovering this I thought to myself "how could this possibly be useful to me" and thought that itmight be a good idea to make a single static database connection for all of the sessions, rather than storing that as a session variable for each session. Does anybody know what would be the pros and cons of this approach?
Do we have to do something special to have ASP.NET partial classes aware of controls that are declared in our user control's base classes? The partial classes keep generating declarations for controls in the base class which mean the controls in the base class get hidden and are null.
Task is to develop class libraries that can be re-use in projects but assambies should be copy righted. By this I mean developer will not give the code of class libraries to the clients yet they will provide the code of there sites/ applications, these libraries will be used just as internal development libraries. I want to make Business Logic Layer, DAL, Business Objects as class libraries
Q1. How I can control unathorised use of libraries ?
I have a requirement related to subdomains. Here are the details.I am using .NET 4.0, IIS7, ASP.NET 4.0. I have an web application hosted as "mycompany.com". I have some clients, say client1, register at my site. I want to give him a
I have an application running on my Home pc and with which i also have expose a webservice. But it is on my local machine.
My question is that i dont have any webserver purchased and i want to call my this local webservice from any where on internet. Is there any free service available on internet which can proxy my local webservice on internet?
I am new to LINQ. when we drag tables we get a dbml file and designer file.
For example DataClasses1.dbml and DataClasses1.designer.cs.
Once we have them then we can start using our LINQ Queries.
In my company project I do not see this designer files and instead there are .tt files which were used as templates to greate ABC.generated.cs files. Is this same as designer class?
I'm working on a webforms aspx app (not MVC) and I'm not sure if I should just create separate pages or somehow make multiple views on the same aspx page for the following scenario: Basically, I need to give the user the option to view a set of data a few different ways (essentially different group by's from a data perspective)... the data is always the same, its just a matter of how to arrange on the page...
each way I need to present the data will essentially consist of 2 repeaters, one nested inside the other. The outer repeater will display a nice header section with the nested repeater showing the list of items under that heading. view by book title (title is outer repeater, with the book list being the nested repeater, yes, multiple books with same title for this example - the app has nothing to do with books, this is just to illustrate)
Book Title: A Good Story Author - Publisher - ISBN Dan Johnson - Smith Publishing - kjdkjfd99898989 Susan Day - Smith Publishing - aa777fd99ff Greg Greger - Corp XYZ - amkj897hgrt554
Book Title: Another Good Story Author - Publisher - ISBN Frank Franky - Corp XYZ - kj3kjfd9d9980 Jason Cambel - Smith Publishing - 7g7fddddttt Jill Breker - Smith Publishing - d9ddt523321
Or, view books by publisher (here the publisher would be the outer repeater and the list, with different fields compared to first view, is the nested repeater.
Publisher: Smith Publishing Title - Author - ISBN A Good Story - Dan Johnson - kjdkjfd99898989 A Good Story - Susan Day - aa777fd99ff Another Good Story - Jason Cambel - 7g7fddddttt Another Good Story - Jill Breker - d9ddt523321
Publisher: Corp XYZ Title - Author - ISBN A Good Story - Greg Greger - amkj897hgrt554 Another Good Story - Frank Franky - kj3kjfd9d9980
so what do I do here? Just making separate pages is simple and would work, but is there something else I should be considering? There will be 3 different views, so 3 pages total if I went that route. Something is making me think I should be doing this all within one aspx page? maybe just toggling the visible property of the repeater controls? but then I was thinking each of these repeater controls is databound, and I assume even if they are not visible they still incurred database hits to get the data, right? and that could be bad?
I want to make an proposal to migrate an ERP like software from Delphi to .Net.The existing software is in Delphi 6 and it is a desktop application.I want to highlight the benefits of moving to .Net (May be Web application) rather than upgrading to latest version of Delphi.
I am following the Nerd Dinner tutorial as I'm learning ASP.NET MVC, and I am currently on Step 3: Building the Model. One part of this section discusses how to integrate validation and business rule logic with the model classes. All this makes perfect sense. However, in the case of this source code, the author only validates one class: Dinner.
What I am wondering is, say I have multiple classes that need validation (Dinner, Guest, etc). It doesn't seem smart to me to repeatedly write these two methods in the partial class:
[code]....
This doesn't "feel" right, but I wanted to check with SO to get opinions of individuals smarter than me on this. I also tested it out, and it seems that the partial keyword on the OnValidate method is causing problems (understandably so). This doesn't seem possible to fix (but I could very well be wrong).