This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeClass { | |
public List<Book> findSpecificBookInFile(String bookName, String filePath) { | |
///////////////////////////// | |
// Parsing the XML file /// | |
///////////////////////////// | |
ParseType xmlType = new ParseType(Parsing.Type.XML, Parsing.Xml.ExtraColumn); | |
ParseFileFactory xmlFileFactory = new ParseFileFactory(xmlType); | |
ParseFile<Parsing.Type.XML> xmlFile = xmlFileFactory.open(filePath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String saveNewBook() { | |
///////////////////////////////// | |
// Construct complex arguments // | |
///////////////////////////////// | |
Characteristics characteristics = new Characteristics( | |
"Moby Dick", // Title | |
"Herman Melville", // Author | |
704 // Num of pages | |
); | |
Price price = new Price(9.99); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface BookingService { | |
TrackingId bookNewCargo(Location origin, Location destination); | |
CargoRouting findCargoRoutingInformations(TrackingId Id); | |
List<RouteCandidateDTO> requestPossibleRoutesForCargo(TrackingId id); | |
void assignCargoToRoute(TrackingId id, RouteCandidate route); | |
void changeDestination(TrackingId id, String destinationUnLocode); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping("/itinerarySelection") | |
public String showItinerarySelection(Request request, Model model) { | |
// Retrieve ID (Here stored with the client) | |
String trackingId = request.getParameter("trackingId"); | |
////////////////////////////////// | |
// Query the Application layer // | |
////////////////////////////////// | |
List<RouteCandidate> routeCandidates = | |
bookingService.requestPossibleRoutesForCargo(trackingId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"book": { | |
"title": "Moby Dick", | |
"author": "Herman Melville", | |
"reviews": [ | |
{"reviewer": "Mark234", "rating_stars": "4.5"}, | |
{"reviewer": "Frank12", "rating_stars": "3.5"}, | |
{"reviewer": "NotPatrick", "rating_stars": "4"}, | |
] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="menu" style="visibility: hidden"> | |
| | |
Javascript: when clicking menu, do: | | |
V | |
<div id="menu" style="visibility: visible"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>This is the result</h1> | |
<p>4<p> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>This is the result</h1> | |
<p>$$$$$$$</p> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The classic scenario - Server-side rendering | |
Don't fear the complex name, Server-side rendering is actually a pretty simple process. | |
To understand, let's first imagine a simple non-web application: A command line application. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################### | |
### RESULT ### | |
#################### | |
// Hello, I am a human readable result! // | |
Computation: "2 * 2" | |
|> Result: 4 |