|
Hi jschell thanks for the response.
Ok so I understand that it needs the normal 80 port to host the web/http requests and an additional port/socket to send/receive the data.
I dont understand how the java side of things hook into the server; with a server like Apache one normally writes a webpage HTML and hosts it ready for a browser/client to request and render it. When the web page includes java eg. flow for the graphing how does that library from the server result in the appropriate code getting to the client ?
I would like to make it so that the rendering of the graph is platform agnostic, so it can be rendered on an android device/OSX device/Windows device/Linux device thats another bit that is puzzling me.
Thanks
Marc
|
|
|
|
|
Hi Marc,
When a client sends a GET request to a socket the socket returns a byte array. The byte array can just be the content of a html-page; a html that on Apache would be a file, but in your case is hard coded by the java server.
Have a look at this: http://cs.au.dk/~amoeller/WWW/javaweb/server.html[^]
Whenever a client sends you a request, you can use the relative url and/or parameters to decide what kind of data the client needs. You then return a byte array that represents that need. Please notice that you can return embedded javascript that uses google chart to display data. The processing of the byte array is done client-side, so your server code do not need to be expensive in processing terms.
I hope it helps.
Kind Regards,
Keld Ølykke
|
|
|
|
|
purplehorace wrote: Ok so I understand that it needs the normal 80 port to host the web/http requests and an additional port/socket to send/receive the data.
It only needs one port. It can be any port but 80 is the normal one.
purplehorace wrote: I dont understand how the java side of things hook into the server
It doesn't have to be java and a C++ implementation would have much less overhead because the java VM by itself is not trivial where a bare bones http responder is.
But if you want to do java then...
1. Java app starts
2. It opens a TCP server socket (port 80), google for examples.
3. It does not 'do' anything associated with html directly because it doesn't need to. You can write a very minimal request parser and, as I already said, you return a http response that you have hard coded.
purplehorace wrote: flow for the graphing ho
What "graphing"? That isn't a minimal process.
If you want to create an entire functioning http server then do so. You might look into tomcat. However that isn't going to be minimal.
purplehorace wrote: I would like to make it so that the rendering of the graph is platform agnostic, so it can be rendered on an android device/OSX device/Windows
That however has nothing to do with achieving a minimalistic server. It has everything to do with what is in the html response. And you can do it either with the minimum version or with a full blown monster. Or fail with both as well if you don't be careful. And a minimalistic http response is more likely to actually work than attempting to put a bunch of enhancements in the response.
|
|
|
|
|
Hi all,
I am not sure how to organize my project.
Given a quite complex application with 100+ DLL (split in GUI, "Shared" (for DTO and interfaces), BL, DAL and some user controls), I currently have folders created for
- GUI
- Shared
- BL (for BL and DAL DLL)
successful builds copy the newly created DLL in the relevant folder, all project references point to the folder.
Especially with GUI (user controls) I run in the problem that under certain circumstances that I can not clearly identify DLL with a older version are searched, but not found when try to open the windows form on which the control is used in the development environment.
In runtime, everything works fine.
Now to my question:
Would you support a solution with just one single folder for all DLL in the whole project?
Any comments on this are greatly appreciated.
Regards
Thomas Heitmüller
|
|
|
|
|
We do not care for organizing the dlls into different folders, and some projects are really complex (more than 100 dll, plus some xml and txt files). Localized resources automatically go into their specific folders (I did not count them here).
By the way, cleaning and re-building the application may help with strange problems encountered when using Visual Studio's designer.
|
|
|
|
|
Hi Thomas,
I have never worked with 100+ dll's, but works for me is to have a build/bin folder that contains all dll's.
I use NAnt to clean that folder, copy 3rd parties dll's there and to build the project dll's into that folder as well.
I hookup visual studio with relative paths to that build/bin folder too. That ensures me that a dll only exists in 1 version e.g. log4net.dll is copied by nant to the build/bin folder, so when visual studio builds into its project temp folder it copies the version of log4net.dll from the build/bin folder.
It might be an idea to have all visual studio projects build into 1 folder too, but I do not have much experience with that. Maybe another can guide you on that.
Kind Regards,
Keld Ølykke
|
|
|
|
|
theitmueller wrote: used in the development environment
What does "development environment" mean exactly?
Are you running this is Visual Studio? Or are you building and then deploying to another box?
Are the dlls all linked statically or are you loading some/all dynamically? If the latter then you MUST have validation code which, at a minimum should provide error output that tells you where it is looking for them?
theitmueller wrote: Would you support a solution with just one single folder for all DLL in the whole project
I have a folder with folders under it for each library. That is because some libraries consist of more than one dll.
Additionally you might look out for libraries that rely on other libraries. So your VS project contains libA but that requires libB and your project does not have libB in it (and libB isn't a normal library on the system.)
|
|
|
|
|
I want to ask some questions related to OOP,I have read many articles but still confused. Kindly provide description instead of any Link.
1). What is the purpose of Inheritance?Why using Inheritance?
2). What is the purpose of Abstraction?
3). What is the purpose of Abstraction?
4). What is design pattern? Why using design pattern?
|
|
|
|
|
|
|
Blame me for that one. I suggested he post it here instead.
What is this talk of release? I do not release software. My software escapes leaving a bloody trail of designers and quality assurance people in its wake.
|
|
|
|
|
BotCar wrote: I suggested he post it here instead. Why, It's a perfectly reasonable Q&A post?
Veni, vidi, abiit domum
|
|
|
|
|
It seemed like more of a discussion type of question that would fit better in a forum than on Q&A. I guess I was wrong.
What is this talk of release? I do not release software. My software escapes leaving a bloody trail of designers and quality assurance people in its wake.
|
|
|
|
|
I think you do have a point there (as to it being a discussion point) but alas, that question sounds a lot like someone's Computer Science 101 homework question.
|
|
|
|
|
Hi,
i'm looking for some good articles about webservices. (if possible for dotnet c#)
More particular :
- Security
- How to maintain / support several client versions.
- how to handle large projects. (e.g. multiple services ? how do they work togheter ?)
All information is welcome.
Thx,
Kurt
|
|
|
|
|
There is Google, and there is the CodeProject articles section, both of which have lots to offer.
Veni, vidi, abiit domum
|
|
|
|
|
Hi,
I am trying to have my project divided in layers. Here is how it's set so far:
- DAL layer: communicate with the database
- Services Layer: cummunicate with the DAL and the UI/UT layers
- UI Layer: is an MVC4 web application
- UT layer: Unit Test project
- Common Layer: has some common classes sheared accross the solution, it has actually the Enum classes.
In my DAL layer, I have:
RepositoryBase<T>: IDisposable where T: class, new() this class has CRUD methods and some others like GetAll(), Filter and so on.
public IEnumerable<T> GetAll()
In my Services layer, which has a reference to the DAL layer, I have, lets say:
ProductManager: RepositoryBase<CT_Product>.
CT_Product is an EF5 entity
It override the DAL GetAll() method and return an IList of Product, Product is a class in my Model.
public IList<Product> GetAll()
Here is my problem: in my UI layer or even the UT layer I don't want to add reference of my DAL layer, I want to only deel with Services layer but when I try to call the Services GetAll() methode I am getting an error which I resolve by adding the DAL layer and I don't like that.
Can someone help by pointing me on how to get that?
Benn
|
|
|
|
|
Hi,
I've found a workaround. Here is what I did in the ProductManager class.
I have added a private property like this:
private RepositoryBase<CH_Product> repo;
and instantiate it in the constructor
#region Constructor
public ProductManager()
{
repo = new RepositoryBase<CH_Product>();
}
#endregion
Here is the GetAll() method
public IList<Product> GetAll()
{
IEnumerable<CH_Product> dalEntList = repo.GetAll();
IList<Product> PrdList = new List<Product>();
Mapping.Mapper.Map(dalEntList,out PrdList);
return PrdList;
}
Now, the UT or UI layer will not reference the DAL layer.
The disadvantage is that, if I want to use the other RepositoryBase methods, I will have to write them all like the getAll method.
Is there any other solution?
Thanks again.
Benn
|
|
|
|
|
benndonwload wrote: I don't want to add reference of my DAL layer
Meaning what exactly? As in a Visual Studio reference? Sorry then you are out of luck.
You have to tie it together somehow and either the business service layer does it or you have to provide another layer that ties them together, for instance by passing factories, interfaces, etc.
Or you use dynamic loading in the service layer.
However without other information I wouldn't suggest doing either. One reason for it would be if you have a truly enormous project, for example with hundreds of tables.
|
|
|
|
|
Hi,
By adding reference, I mean adding a reference to a project (dll) in visual studio by doing a right click on Reference and Add.
What kind of information do you need?
Regards
Benn
|
|
|
|
|
benndonwload wrote: What kind of information do you need?
As I said - the only reason for choosing an alternative would be due to enormous complexity. For example if you had hundreds (plural not singular) of tables (tables not attributes) in your data layer.
modified 30-Aug-13 20:39pm.
|
|
|
|
|
I am in the process of creating a communications server for an application we are building. Pretty standard architecture, multi-threaded, server waits for connection from remote and starts thread to handle data transfer to and from. Not difficult and lots of examples out here. But what is rarely discussed, maybe because it is application specific, is how data is move from the read callback to the object that needs the data. I prefer to keep the functionality compartmentalized.
I have done the queue with a event/delegate implementation. That's fine if all the clients data ends up in one place for processing. But what if an object needs to be paired with a comm handler object? Use an interface? Move the business logic into the handler? That defeats the idea that this should be generic enough to be used in other projects.
All thoughts and suggestions are welcomed!
Thanks,
Doug
I am a Traveler
of both Time and Space
|
|
|
|
|
AeroClassics wrote: All thoughts and suggestions are welcomed!
Attempting to generalize from one case based on hypotheticals is seldom a good idea. The outcome is often code that is never used, overly complex, more fragile (due to complexity) and can even result in more cost when a real case arrives which is totally incompatible.
|
|
|
|
|
JSchell,
I see your point. Solving a specific type of problem this way can lead to overly complex code on some ocassions. However, this is really a specific problem that I tried to explain in a way that required the fewest words in an effort to avoid confusion.
This problem I have solved a couple of different ways and I am faced with it again. I was not completely happy with my other solutions. Having spent the majority of my career working in the Unix/Linux world these things are done differently. While I have written a lot of desktop code in the MS environment I find that I am trying to apply a Unix mindset to Windows desktop problems. I am not sure this is the best way!
So the problem remains. Regardless of where the data stream originates (pipe, TCP/IP etc) waiting for a connection and spinning off a thread to handle that communication channel is the easy part. What I find a bit more difficult to find a decent generic solution for. I am beginning to lean toward using an abstract class or an interface to put the burden on the user of the server object. This is just passing the buck so to speak. Unfortunately I also have to use this object!
This lead to the original question. What do most folks do when they need to move data from one object to another? I realize that you can just invoke a method in another object if you have a reference but that, in my personal opinion, is wrong. The server object should not know about the consumer of the data he should just make it available. Typically I toss the data into a queue and invoke an exposed event. But perhaps there is a better way?
Doug
I am a Traveler
of both Time and Space
|
|
|
|
|
AeroClassics wrote: I realize that you can just invoke a method in another object if you have a
reference but that, in my personal opinion, is wrong.
As a general statement - your conclusion is specifically wrong. Basically it condemns OO entirely as well as ignoring the historical concept of RPC and the problems with that when people decided that fine grained objects were the only way to go. (Early adopters of Java RMI experienced the same problem and that includes earlier JEE containers.)
AeroClassics wrote: But perhaps there is a better way?
If I have a specific architecture or business need for a message queuing system then I use one. I don't use it just as a whim however because of the complexity involved.
|
|
|
|