|
dabs wrote: would like some input from others regarding the best design for this
Your not asking about design, you are asking about what feature should be implemented. That question needs to be asked for each project based on the project definition.
An admin deleting threads and all it child replies is not at all equivalent to someone deleting text in a word processor.
For this reason I don't believe the Undo is a good fit. A recycle bin where it must be manually deleted or perhaps expired but until then can be restored sounds like a much better use model for an Administrator and that problem domain.
led mike
|
|
|
|
|
Hi,
I've been searching the web for months but although there is a lot of stuff to find about sockets between client and server, I've found very little on designing a protocol to talk over this socket.
For what i need (basic question/response and synchronizing data, which i currently do using xml), there is little to find. And so i learned a lot of hard lessons involving recoding a lot of the app due to stupid errors which i did not forsee due to lack of experience.
Does anyone know some sources for more information about this subject or have a view on protocols for client/server apps? It's my first Client/Server application and I feel like i am in the dark.
|
|
|
|
|
A 'Protocol' is nothing more than an agreed upon conversation.
When you walk up to someone and say hello and expect a hello in response you have a protocol.
You are free and open to do what you want really but since you are shuffling files back and forth perhaps you want to look at an established file transfer protocol. Loop up RFC 959 for FTP[^] and start reading.
|
|
|
|
|
Hmm.. I understand that. Seeing I come from a system administrator background I have enjoyed reading a couple of the RFC's in the past
However: I am not transmitting files over the socket.
The actual question is: are there gotcha's in protocol design (for instance i found out that having an <eof> parameter to let the client detect when the command is done is an abolute must).?
|
|
|
|
|
Noctris wrote: are there gotcha's in protocol design (for instance i found out that having an parameter to let the client detect when the command is done is an abolute must).?
Not sure what that means.
Noctris wrote: It's my first Client/Server application and I feel like i am in the dark.
Not unusual, it's a large subject.
Noctris wrote: I've found very little on designing a protocol
Yeah I don't remember ever seeing anything like that. Try looking at existing protocols rather than looking for something that teaches protocols. I suggest you start with some simple application level protocols like HTTP/FTP/POP3 of course...
Noctris wrote: what i need (basic question/response and synchronizing data, which i currently do using xml)
That sounds like SOAP so you may not need to create your own protocol. It's difficult to say for sure with the limited information you provided.
led mike
|
|
|
|
|
Hi!
I'm looking for an approach for creating server data presentation (input) on client side.
I have a client application (Delphi) and server application ASP.NET.
Server can get different set of data (text, date, true/false etc).
Server can change required data set and than client should react on that change by changing controls for server data presentation.
So the question is: Are there any approaches or existing technologies to support such client-server interaction.
I suppose that it may be done via some intermediate user creating language in some xml format for example. But there are many others questions in such an approach:
How to create control events handling routines? (For example validation, etc)
|
|
|
|
|
I don't find any question in your post related to your subject line. You seem very confused about pretty much everything. I suggest that an internet forum is the wrong format for solving your problems. You need some good books or something.
led mike
|
|
|
|
|
Hi,
I've been coding in .NET and Java and C++ for a few years now and I still haven't
quite got my head round Association ,Aggregation and Composition.
I know a the difference conceptually, eg. A Bank *has* branches (Aggregation), eg. A Child *has* a toy (Composition).
The thing that confuses me, is when it comes to coding the relationship.
I've looked at examples on the Web and it still confuses me.
C# and Java
public class Boy
{
public void PlayWith(Toy toy) {toy.play();}
}
public class Bank
{
List<branch> branches = new List<branch>(2) {new SydneyRdBranch(); new ParisRdBranch(); }
}
</branch></branch>
Please could someone explain how to write Association, Aggregation and Composition in Code please.
Many Thanks
Tom
|
|
|
|
|
AFAIK association encompasses both aggregation & composition, the difference between composition and aggregation is that with composition when the containing object goes out of scope then so is the composed object for example a car is composed of an engine once the car goes out of scope the engine goes with it.
In contrast aggregation means that the even when the containing object goes out of scope the aggregated object still remains for example a car could have a driver if the car goes out of scope this doesnt mean that the driver object will.
It really boils down to whether the object in the contained object is created inside or passed in, your Boy example is Aggregation as the Toy is passed in, and the Bank example is composition as the Branches are created internally
hope this helps
|
|
|
|
|
Just explanaing further..
Toy example is Aggregation.
As Toy instance is created out side the scope of Class Boy. So deletion of object of Boy will not make impact of object of Toy.
Bank has composition relationship with BankBranch.
Since instances of BankBranch created inside scop of class Bank so if object of Bank goes out of scope then objects of BankBranch will be get deleted (destructor of Bank must be delete objects of BankBranch)
Akash
|
|
|
|
|
a boy has a hand : composition, there is no hand without the boy.
an appartement has a building : composition
----------------
in contrast :
a car has a driver: aggregration
|
|
|
|
|
Is anyone using this, and if so, what have your experiences been like so far?
Semicolons: The number one seller of ostomy bags world wide. - dan neely
|
|
|
|
|
Unity - opinions are divided.
|
|
|
|
|
I'm unanimous on this, as I've told you before (when there was some animal in your reply).
|
|
|
|
|
Luc Pattyn wrote: I'm unanimous on this
Why thank you Mrs Slocombe.
|
|
|
|
|
I currently have a sizable code base with LinFu that I can't afford to rewrite from scratch, and I want to increase the code coverage rate on existing portions of the library which don't have any coverage at all. Is there any way to apply unit tests to existing code and increase the coverage rate, or is this an exercise in futility?
|
|
|
|
|
Philip Laureano wrote: Is there any way to apply unit tests to existing code
Couldn't you use LinFu to do that?
I just spent like two minutes looking at your LinFu and that was the first thing I thought of. Also though, I have used NUnit for several years and I find the quote above from you a bit confusing because of course you can apply unit tests to existing code. I must be missing something.
led mike
|
|
|
|
|
led mike wrote: Couldn't you use LinFu to do that? [Confused]
I just spent like two minutes looking at your LinFu and that was the first thing I thought of. Also though, I have used NUnit for several years and I find the quote above from you a bit confusing because of course you can apply unit tests to existing code. I must be missing something.
Hi Mike,
Sorry for the confusion. This question is more of a philosophical question rather than a technical one, so I'll go ahead and rephrase it: "Should unit testing be applied to an existing code base that already works?"
If the rest of the code base changes very little, wouldn't the tests themselves be a case of YAGNI?
led mike wrote: Couldn't you use LinFu to do that?
I suppose LinFu could "dogfood" itself and put the tests everywhere, but that's beside the point. The real question here is that is there really any value (read: value = quality) gained in adding unit tests for code that has already been proven to work on an innumerable amount of occasions?
|
|
|
|
|
Philip Laureano wrote: The real question here is that is there really any value (read: value = quality) gained in adding unit tests for code that has already been proven to work on an innumerable amount of occasions?
If you're never ever going to change the code again - no. If there's the possibility that the code could change - yes. The unit tests will help give you confidence that your code still works post changes, which is (obviously) hugely important.
|
|
|
|
|
Philip Laureano wrote:
If the rest of the code base changes very little, wouldn't the tests themselves be a case of YAGNI?
Why not simply add the tests once you do need to change the code?
As you say, if it won't change then it's pretty pointless.
On the other hand, you might find a bug or two in the existing code if you add tests.
|
|
|
|
|
I hope somebody can offer me some guidance as I'm a little stuck and not sure what exactly to do.
I have a nicely designed system that has utilised a couple of abstract classes which then have concrete classes implementing them.
I'm using the base classes to encapsulate functionality that is applicable across the objects but only use the concrete classes in the application with each concrete class being used in a specific way (so that you wouldn't swap one out for the other)
I've run into an issue unit testing, trying to use [Moq] as it is unable to mock a class that inherits from an abstract base class where the methods and properties are not virtual.
The only way out of the situation is to either create interfaces specific to each of the classes that inherit from the abstract base (which seems pointless to me, since I'd implement an interface, have current concrete class implement the interface and then replace all instances where concrete class was used with interface) or I have to mark the methods and properties of the base class as virtual and cause a performance problem.
I don't like either option and wondered if anybody had come across a similar situation and how they had resolved it?
|
|
|
|
|
I'm confused by the title, if you had been writing this system using TDD you would not have the issue because you would have designed your classes with testability in mind.
Also it's not Architecture vs TDD they aren't conflicting by any means I practice TDD and have found it a good way to design you generally end up with objects that are loosely coupled and because of the code coverage gained you can perform constant refactoring leading to an architecture that evolves more easier
|
|
|
|
|
The issue I'm having is that I am unable to use the testing technology that is available to enable me to adequately test the system by isolating each layer.
To be forced to have to use interfaces where there really is no need has a 'smell' to it.
The system wasn't Test Driven Design, it was designed using normal OOP techniques and it is only trying to use Test Driven Development techniques that I have run into problems.
I have found one solution and that is TypeMock which will happily mock a class that has an abstract base class the only downside being the cost.
Having spent a fair amount of time looking at Mock 'products' it seems to me that for the most part you end up having to sacrifice legitimate design choices or alter code so that it can cause performance penalities (such as marking methods/properties as virtual) in order to be able to test.
I haven't come up with any answers and am more than happy to hear other peoples opinions about this.
|
|
|
|
|
Mock objects are designed to be used up front. Attempting to apply them at the end of a development is pretty much a futile issue.
|
|
|
|
|
Can you please elaborate on why?
In a well designed system with good separation of concerns it should be easy to use Mock objects, is it not simply that generally the technology we have in .Net to support mock objects is not up to the task?
|
|
|
|