File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Internet/Intranet apps using the same code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Internet/Intranet apps using the same code" Watch "Internet/Intranet apps using the same code" New topic
Author

Internet/Intranet apps using the same code

K Robert
Ranch Hand

Joined: May 16, 2003
Posts: 116
Can an internet app and a separate intranet app use the same code or functionality?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

In most cases there's no difference at all between intranet and Internet apps, although development for the Internet should particularly emphasize security and bandwidth minimization. Do you have a particular scenario in mind that you're concerned about?


[Jess in Action][AskingGoodQuestions]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38363
    
  23
Please explain more. I can see that two applications might easily share code, but that might not be what you meant.
K Robert
Ranch Hand

Joined: May 16, 2003
Posts: 116
Yeah, sharing code, but one app would be on the internet and one on the intranet and possibly not on the same server. They would share some functionality between the two apps.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38363
    
  23
Can't see any reason why similar functionality can't use the same code. That's the advantage of object-oriented software.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
A single software application can be accessed via Internet URL and a Intranet URL. In this case there is only one code base.

Two applications can share similiar code. Whether the applications are accessed via Internet URL or not does not make any difference.
K Robert
Ranch Hand

Joined: May 16, 2003
Posts: 116
They both would have their own architectures, but reuse code that is needed in both? Where would that code be located(the code that they would share)? Would this be a scenario where SOA is predominant?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

You might be using the words "intranet" and "Internet" differently from the rest of us. An "intranet" application is one that runs behind a company's firewall; an "Internet" application is one that is exposed to the world. These terms really don't mean anything more than that; it sounds to me like you might be implying a lot more by your question than we're picking up on. Can you be more explicit?
K Robert
Ranch Hand

Joined: May 16, 2003
Posts: 116
Yes, one would be behind the firewall(intranet) for internal use and one for public use(internet). But if they are really no differences other then security, I guess my question should have be: can 2 different applications share the same code? If so, would the shared code be treated as a 3rd app?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

I think you're also using the words "share code" differently than the rest of us! Two applications can "share code" and be installed on two different machines, two different operating systems, two different continents. Usually when two applications "share code" we mean that some of the source code ends up being compiled into the two apps (or copies of a common library are used by both); they don't need to share any physical entities at runtime.

Here's where I'm sure you mean something different. So are you thinking about a single server with two web applications running on it, one pointed inward, and one pointed outward? There's certainly no reason why two such applications couldn't share a directory full of common code libraries; those libraries might make up the bulk of the application, or even all of it.

Now, there are all kind of things that could be different about the two applications,which is different from must be different. Maybe the two use different mechanisms for user authentication, perhaps. They might use separate databases, so they'd need different drivers or different configuration.

But I'm still just kind of jabbering on, trying to work out what you're really asking!
K Robert
Ranch Hand

Joined: May 16, 2003
Posts: 116
Ernest Friedman-Hill wrote:Two applications can "share code" and be installed on two different machines, two different operating systems, two different continents. Usually when two applications "share code" we mean that some of the source code ends up being compiled into the two apps (or copies of a common library are used by both); they don't need to share any physical entities at runtime.

Here's where I'm sure you mean something different. So are you thinking about a single server with two web applications running on it, one pointed inward, and one pointed outward? There's certainly no reason why two such applications couldn't share a directory full of common code libraries; those libraries might make up the bulk of the application, or even all of it.

Now, there are all kind of things that could be different about the two applications,which is different from must be different. Maybe the two use different mechanisms for user authentication, perhaps. They might use separate databases, so they'd need different drivers or different configuration.


This is pretty much the answer I was looking for. Thanks! Sorry about not being more specific.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38363
    
  23
We got there in the end . . .

Only too pleased to help
 
Consider Paul's rocket mass heater.
 
subject: Internet/Intranet apps using the same code