|
Thank you for the code, although it had to be modified a bit to run, but what do you mean by the following:
- (derived class) always call base in overriden virtual method/property?
This I do get, and I find it a good OO-realted advice:
(abstract class) only declare fields as private.
Thanks for the link that lead to this:
[^]
... which talks about the usefulness of it all.
modified 12-Jan-14 7:43am.
|
|
|
|
|
Hi,
You are welcome. Maybe you should post the runnable code, if you think it will help people.
"but what do you mean by the following:
- (derived class) always call base in overriden virtual method/property?"
Inheritance in OOP is relatively loose. The only thing you can be certain about is that constructors are chained e.g. new Y() will call the constructor of Y that as its first statement will call the constructor of A, etc.... all the way up til the contructor of Object. You can then have your constructor code in different implementation called on the way back from Object.
For all other methods/properties no such guarantee exists. In other words it is optional to call a base-method, which makes it pretty hard to manage private fields in the base class
So these 2 go together:
-----------------
- (abstract class) always expect virtual methods/properties to be called by derived classes
- (derived class) always call base in overriden virtual method/property
-----------------
It is just 2 calling convention rules that mimic the constructor chaining for all virtual methods. In this way we can design interdependency between A and X - even though the language supports that you can avoid calling base methods/properties.
I hope it makes sense... otherwise I can elaborate.
Thx for the nice link, btw.
Kind Regards,
Keld Ølykke
|
|
|
|
|
Hi Community. I have some questions about Loose Coupling Pattern in the Application Design. Is Loose Coupling Pattern The Best pattern for a TDD (Test Driven Development). Can you tell other Patterns in Application Design for TDD? Please can you bring some examples about Loose Coupling?
modified 8-May-21 21:01pm.
|
|
|
|
|
Hi Omar,
Loose Coupling it isn't a pattern, but a programming best practice. You are talking about Inversion of Control and Dependency Injection topics. I suggest you to read the following article to introduce yourself in the question : http://www.codeproject.com/Articles/25733/Dependency-Injection-Pattern-Loose-Coupling
|
|
|
|
|
Antonio Ripa wrote: but a programming best practice
Within reason of course.
|
|
|
|
|
jschell wrote: "best practice"
FIFY
|
|
|
|
|
Hi,
I have asked "Which Software Patterns makes your libs/apps testable?"
here[^]
At the bottom you will find a nice short list of patterns/principles to use.
Kind Regards,
Keld Ølykke
|
|
|
|
|
Hallo,
im a writing a quite bigger than usually project, and I am dealing with some questions considering architecture and security.
To make it short, I have a Windows server with a WCF installed, which is waiting for an outside question from a client that needs some updates.
The updates have to be created from a dll, which accesses a Database, runs sql scripts and provides a zip file in the end.
Is it ok to call the dll from a function inside the WCF? That function should then pass a string which needs the library.
Would it be better to call a programm that consequently calls the dll, thus having a separated instance between WCF Service and the library, which accesses the database?
Or maybe there is a better solution?
Thanks in advance.
|
|
|
|
|
How many levels of separation do you want. Your WCF should be enough separation, I would have it call the DLL (which IS another program after all). There may be some security issues around you web server and the WCF communications that you may need to address.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Some reasons for using a separate program.
- The dll is unstable and because of that it can cause an application exit.
- The dll is already encapsulated in an executable and in fact is easier to use that way or even can only be used that way.
- The dll is not structured for multi-threading and you want to use it in more than one thread.
|
|
|
|
|
1. Is the DLL a .NET Assembly?
2. Do you own the DLL?
Since it is a DLL, it is going to be loaded in the same process as your WCF service. If you are the author of the DLL or you trust the source, you should be able to safely use the DLL directly from the WCF service. However, if you don't own it or you're not sure of the source, then you can load the DLL in a separate AppDomain and access it from there, mind that it there will be a overhead though.
|
|
|
|
|
Hii
I have a doubt in web browser related to web designing.Why html image alt text doesn't work in Firefox and IE.Could you tell me the reason?
http://www.iqtechways.com
|
|
|
|
|
I'm sorry, but you have picked the wrong forum for this question. Please try the web development forum, and when you do, post some code to demonstrate the problem.
|
|
|
|
|
The "alt" tag is meant to show text when the image isn't loaded, the "title" tag is meant for a description of an image on cursor hover. IE has been doing that wrong for many years, where Firefox follows W3C standards. A properly coded webpage should have both "alt" and "title" tags. So you can use Title For that Purpose
modified 28-Nov-13 0:12am.
|
|
|
|
|
i want to implement a project , how can i start initially.
|
|
|
|
|
Open Visual Studio, select the project type that you are after and then give your project a name?
You have given too little information for any serious answer
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Well, it's very outrageous comment I think.
|
|
|
|
|
|
|
Requirements?
What it means?
|
|
|
|
|
|
1) Do you have the requirments or Problem statement?
2) Is the technology defined?
3) Are you well versed in the corresponding technolgy?
"Implement a project" is a very broad term, so any more details is welcome
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
|
First, You have to design architecture and algorithms.
Second, gather information of input and output and open sources and components which will will be used on your project.
Last, implement your architecture and algorithms by your hands.
|
|
|
|
|
Post a message in Codeproject, preferably in the Lounge.
It should read: "Plz send codez. Urgenz".
|
|
|
|