Latest / CyberSecurity Summary / Beginning Java MVC 1.0: Model View Controller Development to Build Web, Cloud, and Microservices Applications
Transcript
- 0:00Speaker 1: Okay, let's untack this. Welcome to the deep dive. We're
- 0:04Speaker 1: all about taking complex topics, cutting through the noise, and
- 0:06Speaker 1: really giving you those vital insights quickly, thoroughly, and hopefully
- 0:12Speaker 1: without that feeling of being overwhelmed. Exactly today we're diving
- 0:15Speaker 1: deep into Java MVC one point zero. It's well, it's
- 0:19Speaker 1: a pretty foundational design pattern, really critical if you're building
- 0:22Speaker 1: modern web apps, cloud services, even micro services. And our
- 0:27Speaker 1: guy for this is Peter Spieth's excellent book Beginning Java
- 0:30Speaker 1: Mvc one point zero.
- 0:32Speaker 2: Yeah, it's exciting stuff because we're not just looking at,
- 0:35Speaker 2: you know, a technology, We're digging into a fundamental design pattern,
- 0:38Speaker 2: one with some serious history behind it. Our goal here
- 0:41Speaker 2: is to give you a clear, kind of structured understanding
- 0:44Speaker 2: of Java mvc. What are the core pieces? How does
- 0:46Speaker 2: it fit into the whole Java enterprise world. Yeah, and
- 0:49Speaker 2: you should walk away with some practical insights, not just
- 0:52Speaker 2: the what, but the why? Why does this pattern even matter?
- 0:55Speaker 2: What does the lit developers actually do?
- 0:57Speaker 1: Absolutely? So, let's start big picture model. You control NBC.
- 1:00Speaker 1: It's not just Java, right, it's this fundamental software design pattern.
- 1:04Speaker 2: Oh yeah, fundamental.
- 1:05Speaker 1: It breaks down complex apps into three distinct roles, three
- 1:10Speaker 1: interconnected pieces. Think of it like I don't know a
- 1:13Speaker 1: well oiled machine, where each part has a specific job.
- 1:17Speaker 2: A good analogy.
- 1:18Speaker 1: So at the core you've got the model. This is
- 1:20Speaker 1: all about the application data, specifically the data the user
- 1:24Speaker 1: sees and might change. Right the state and the key
- 1:27Speaker 1: thing is the model is totally ignorant. It has no
- 1:30Speaker 1: idea how that data gets presented or how the application flows.
- 1:34Speaker 1: It's just the data, the source of truth.
- 1:36Speaker 2: Agnostic that's the word often used. It's data centric, not
- 1:40Speaker 2: presentation aware.
- 1:42Speaker 1: Then you have the view, Its job is purely presentation.
- 1:45Speaker 1: How does the model's data look to the user? All
- 1:47Speaker 1: the interactive bits, inputs, buttons, menus. That's the view.
- 1:51Speaker 2: Could be a desktop gooi, a mobile app screen, or
- 1:54Speaker 2: most often for us, a webpage.
- 1:56Speaker 1: It's the user's window basically exactly. And finally, the controller.
- 2:00Speaker 1: This is the coordinator, the brains. Maybe it handles user input,
- 2:04Speaker 1: It talks to the model to get or update data,
- 2:07Speaker 1: contains the application logic, calculations, data transformations, that kind of.
- 2:10Speaker 2: Thing, And crucially it decides how data gets stored or retrieved,
- 2:15Speaker 2: maybe from a database.
- 2:16Speaker 1: Right, But it doesn't care about how the view looks.
- 2:19Speaker 1: Its job is managing the flow, not painting.
- 2:22Speaker 2: The picture precisely keeps things separate.
- 2:25Speaker 1: Okay, to make this more concrete, let's use this book
- 2:27Speaker 1: club example application from the book. We'll keep coming back
- 2:30Speaker 1: to it.
- 2:30Speaker 2: Good idea.
- 2:31Speaker 1: So in book Club, the books themselves, their rental status,
- 2:35Speaker 1: member details. All that stuff lives in the model.
- 2:39Speaker 2: The core entities.
- 2:40Speaker 1: The web page is showing search results, the member sign
- 2:42Speaker 1: up form, the menus that's all view, the user interface,
- 2:46Speaker 1: and the controller that's the logic that takes your search
- 2:49Speaker 1: request or updates a book status when you rent. It
- 2:52Speaker 1: fetches member info from the database and then decides which
- 2:55Speaker 1: view to show next.
- 2:56Speaker 2: It handles the doing part based on user actions.
- 2:59Speaker 1: Exactly the logic behind it all.
- 3:01Speaker 2: And if you connect this to the bigger picture, like
- 3:03Speaker 2: you said, NBC isn't new. It goes way back.
- 3:06Speaker 1: Yeah, you mentioned history, right back.
- 3:08Speaker 2: To the nineteen seventies small talk. Originally, it didn't get
- 3:12Speaker 2: the explicit MVC name until the late.
- 3:14Speaker 1: Eighties wow, seventies.
- 3:16Speaker 2: But it's real power. Well that became obvious in the
- 3:18Speaker 2: nineties with the Internet boom. The pattern adapted surprisingly well
- 3:22Speaker 2: to web applications, even though AHGTP is inherently stateless.
- 3:26Speaker 1: That statelessness is always the challenge, isn't it always?
- 3:29Speaker 2: And it led to specific Web NBC challenges like how
- 3:33Speaker 2: do you keep track of a user across multiple requests?
- 3:36Speaker 2: That's where sessions came in, usually managed by frameworks using
- 3:39Speaker 2: cookies okay? Or how do you cleanly get modeled data
- 3:43Speaker 2: into the view. Templating engines solve that thing things like
- 3:47Speaker 2: user dot first.
- 3:47Speaker 1: Name right, accessing the data easily, and.
- 3:49Speaker 2: How do you update the page? We moved from reloading
- 3:51Speaker 2: the entire page to partial updates using scripts like ajax,
- 3:55Speaker 2: much smoother. And while other patterns like MVVM came along,
- 3:59Speaker 2: often adding more automation for data binding, they still build
- 4:02Speaker 2: on that core MVC idea of separating concerns.
- 4:05Speaker 1: That's a great historical context. So if MVC is that old,
- 4:09Speaker 1: what makes Java MVC this JSR three seventy one the
- 4:12Speaker 1: modern choice for enterprise JABA.
- 4:14Speaker 2: Good question. Java MVC is the dedicated standardized framework for
- 4:17Speaker 2: Java EE eight and now Deakarta E eight and later.
- 4:21Speaker 2: It filled the gap many developers felt.
- 4:23Speaker 1: Was there a standard was needed?
- 4:25Speaker 2: Kind of yeah, And it's important to remember JSR three
- 4:27Speaker 2: to seventy one defines the interface. You need an implementation
- 4:31Speaker 2: like eclips Crazo to actually use it.
- 4:33Speaker 1: Okay, So it's a spec needs a library exactly.
- 4:35Speaker 2: And what's clever is how it extends JXRS, Java's RES technology.
- 4:40Speaker 2: It's built on jxrs.
- 4:42Speaker 1: Ah, so it leverages RES right.
- 4:44Speaker 2: That makes it lean, gives it a concise style, and
- 4:47Speaker 2: it means it plays really nicely with ajx out of
- 4:49Speaker 2: the box. Because it's already using JXRS for handling requests.
- 4:52Speaker 1: That JXRS connection seems key. Does that feed into the
- 4:56Speaker 1: pros and cons?
- 4:57Speaker 2: Definitely? The pros well. Being closer to HTT means potentially
- 5:02Speaker 2: less memory overhead compared to some component based framework that
- 5:05Speaker 2: build big UI trees in memory like JSF Maybe potentially, Yeah,
- 5:09Speaker 2: it can have a smaller footprint. Plus being part of
- 5:11Speaker 2: the Jakarta EE spec means reliability, maintenance, community support, okay, stability,
- 5:15Speaker 2: and if you've used older frameworks like struts, the action
- 5:19Speaker 2: based approach of Java MBC will feel pretty familiar.
- 5:22Speaker 1: Makes sense.
- 5:22Speaker 2: What about the downsides, Well, it doesn't totally hide HGTP.
- 5:26Speaker 2: You still need some awareness of requests response as.
- 5:28Speaker 1: Headers, so not quite as much abstraction.
- 5:31Speaker 2: Right, and it doesn't typically offer two way data binding
- 5:35Speaker 2: out of the box. If a user types in a
- 5:37Speaker 2: form you the developer usually need to write code in
- 5:40Speaker 2: the controller to explicitly update the model.
- 5:43Speaker 1: Ah okay, so a more manual work there compared to
- 5:46Speaker 1: some other frameworks.
- 5:47Speaker 2: Potentially, Yes, it's a trade off more control, maybe a
- 5:50Speaker 2: bit more boilerplate. In some cases. It's about balancing that
- 5:53Speaker 2: abstraction versus control over HTTP.
- 5:56Speaker 1: So when would that extra control be a real advantage
- 5:59Speaker 1: and when might it just be extra work?
- 6:02Speaker 2: Great point. You benefit most when you need really fine
- 6:05Speaker 2: grain control over the HTTP request response. Maybe you're building
- 6:09Speaker 2: complex rest APIs that also serve htmail pages or highly
- 6:12Speaker 2: optimize micro services. The flexibility is powerful. Then the drawback
- 6:16Speaker 2: if you just want something super high level where the
- 6:18Speaker 2: framework does almost everything automatically. Maybe for simpler cru'd apps.
- 6:22Speaker 2: It depends on the project control versus speeded development.
- 6:24Speaker 1: Sometimes that makes a lot of sense. Okay, let's talk
- 6:27Speaker 1: about the foundation. Java NVC doesn't just run anywhere, right,
- 6:31Speaker 1: It needs that Java Enterprise Edition Server environment Java EE
- 6:36Speaker 1: or Jakarta E.
- 6:37Speaker 2: Absolutely, it relies on that infrastructure.
- 6:39Speaker 1: And Java itself. Well, it's been the go to for
- 6:41Speaker 1: enterprise apps, for ages, stability, database connections, talking to other systems,
- 6:47Speaker 1: handling complex logic. It's built for that scale and just
- 6:50Speaker 1: for context. Java started with Sun, went through j to EE,
- 6:53Speaker 1: then JG and now Jakarta E under the Eclipse Foundation.
- 6:56Speaker 1: We're focusing on Jakarta E eight and Java eight features
- 6:59Speaker 1: here right.
- 7:00Speaker 2: And the key is that Jakarta E provides this whole
- 7:03Speaker 2: ecosystem Java MVC plugs into. It's not standalone.
- 7:06Speaker 1: What are the key pieces it relies on Well.
- 7:08Speaker 2: JXRS, as we said, innovational, then JPA, the Java Persistence
- 7:13Speaker 2: API for database access handles all the tricky SQL stuff.
- 7:16Speaker 1: Usually OHRM right, Object relational mapping.
- 7:19Speaker 2: Exactly and critically CDI context and dependency injection. That's how
- 7:23Speaker 2: Java MVC manages beans their life cycles. It's core.
- 7:26Speaker 1: CDI sounds important.
- 7:27Speaker 2: It is plus being validation for data integrity and for learning.
- 7:32Speaker 2: The book recommends GlassFish Server version five point one, open source,
- 7:36Speaker 2: free group.
- 7:37Speaker 1: Of development, and you can manage GlassFish different ways.
- 7:39Speaker 2: Yeah, command line, a Sadman, WEBGUI, even Arrest API pretty flexible.
- 7:45Speaker 1: Okay, foundation set. Let's dive back into the MVC components,
- 7:49Speaker 1: but specifically the Java MVC way, starting with the model
- 7:54Speaker 1: and that CDI thing you mentioned.
- 7:55Speaker 2: Right, So Java MVC uses CDI two point zero to
- 7:58Speaker 2: manage your model classes. Yeah, you typically don't do new
- 8:01Speaker 2: my model. CDI handles creating and providing instances.
- 8:05Speaker 1: How does it know which classes to manage?
- 8:07Speaker 2: Usually annotate them. The simplest is that named You put
- 8:10Speaker 2: it named on your Java being, say your book class,
- 8:12Speaker 2: and CDI takes over makes it available to your views.
- 8:15Speaker 1: Okay, annotation magic pretty much.
- 8:17Speaker 2: And CDI manages the lifespan of these objects through scopes.
- 8:20Speaker 1: This is really important to the copes, like how long the
- 8:22Speaker 1: data lasts exactly.
- 8:23Speaker 2: There's request scope, a new instance for every single HTTP
- 8:27Speaker 2: request lives only for that request response cycle. Good perfect
- 8:30Speaker 2: for temporary stuff like the data submitted in a form.
- 8:33Speaker 2: Then session scope, the instance sticks around for the user's
- 8:36Speaker 2: entire browser session. Great for things like user login information, shopping.
- 8:41Speaker 1: Cards, data that needs to persist across pages for one
- 8:44Speaker 1: user precisely.
- 8:45Speaker 2: Then there's redirect scope. This one's need. It supports that
- 8:48Speaker 2: post redirect get pattern.
- 8:50Speaker 1: Ah to stop double form submission exactly.
- 8:53Speaker 2: The object lives across the post request and the following
- 8:56Speaker 2: get t redirect super useful.
- 8:58Speaker 1: It definitely needed that before.
- 8:59Speaker 2: Oh yeah, there's also application scope for data shared across
- 9:02Speaker 2: all users living until the app stops, and dependent scope
- 9:06Speaker 2: the default, which just inherits the scope of whatever injects it.
- 9:10Speaker 1: Lots of options. What if you need something really simple.
- 9:12Speaker 2: For quick things, there's a built in Javacs dot mvc
- 9:15Speaker 2: dot model's object you can inject into your controller. Just
- 9:18Speaker 2: add key value pairs to it and they're available in
- 9:20Speaker 2: the view. No need for a dedicated class.
- 9:22Speaker 1: Sometimes handy for simple cases. Okay, so CDI managed the
- 9:25Speaker 1: model data in its life, Now how do we show
- 9:27Speaker 1: it the view?
- 9:28Speaker 2: Right? The view layer. Java MVC mainly uses two templating
- 9:33Speaker 2: technologies here, JSPS, Java server pages and facelets.
- 9:37Speaker 1: JSPS are the older ones, right.
- 9:39Speaker 2: Yeah, classic. You mix HTML with dynamic bits the modern way,
- 9:43Speaker 2: and what the source recommends is using expression language el
- 9:46Speaker 2: that syntax.
- 9:47Speaker 1: Like dumb butt title exactly.
- 9:49Speaker 2: Access is your CDI beans cleanly. You should also use
- 9:52Speaker 2: JSDL tags like CT ORH for loops set to different conditions.
- 9:56Speaker 2: Avoid embedding raw javascriptlets percent jsps. If you can keep
- 10:02Speaker 2: logic out of the view, keep it clean definitely, and
- 10:05Speaker 2: the source really advises against using implicit objects like param
- 10:08Speaker 2: directly in the view that mixes controller responsibilities with presentation.
- 10:12Speaker 2: Bad idea, Got it?
- 10:13Speaker 1: What about facelts.
- 10:14Speaker 2: Facelits is newer xmail based came from the JSF world
- 10:17Speaker 2: Livesten webi nfus. Its strength is templating reasonable layouts using
- 10:22Speaker 2: tags like EI dot composition, uid, define, UI dot insert
- 10:26Speaker 2: really good for consistent page structure.
- 10:28Speaker 1: Sounds powerful any catches yes, a.
- 10:30Speaker 2: Big one for Java MBC. While facelts is great for templates.
- 10:33Speaker 2: You should avoid mixing in actual JSF components or using
- 10:36Speaker 2: JSS specific expression language. Why is that paradigm mismatch? JSF
- 10:41Speaker 2: has its own life cycling component model. Trying to shoehorn
- 10:44Speaker 2: that into Java mvc's request driven model can cause weird
- 10:47Speaker 2: issues in instability. Stick to facelets for templating, use standard
- 10:51Speaker 2: EEL for data access in Java mvc.
- 10:53Speaker 1: Okay, noted, keep JSF stuff out of Java mvc.
- 10:57Speaker 2: Facelts Right now, the controller, how do you make one annotations?
- 11:00Speaker 1: Again?
- 11:00Speaker 2: You bet at controller on the class, usually paired with
- 11:03Speaker 2: at path to define the base URL like at path books.
- 11:07Speaker 1: Okay, and methods handle requests YEP.
- 11:11Speaker 2: For a get request, say to show a list of books.
- 11:13Speaker 2: A method might return a string the name of the
- 11:15Speaker 2: JSP or Facebook file like booklist dot jsp simple, or
- 11:20Speaker 2: for more control, it can return a response object that
- 11:23Speaker 2: lets you set h GDP status codes, headers, cookies explicitly.
- 11:26Speaker 1: Ah more power there, and.
- 11:28Speaker 2: The final URL path is built up application path class
- 11:31Speaker 2: at path method at path all cancatenated makes sense.
- 11:34Speaker 1: How does the controller prepared data for the view?
- 11:37Speaker 2: It injects the needed CDI beans the model objects using
- 11:39Speaker 2: it inject that, it calls methods on them, sets values
- 11:42Speaker 2: whatever is needed before the view gets rendered.
- 11:44Speaker 1: Okay, and post requests like.
- 11:47Speaker 2: Forms handled similarly, but you use annotations like at form
- 11:51Speaker 2: paarent book title within the method arguments to grab the
- 11:56Speaker 2: submitted data directly.
- 11:57Speaker 1: Okay, that covers the core components. What about making is
- 12:00Speaker 1: more robust handling user input validation crucial stuff?
- 12:03Speaker 2: So you capture data from forms or query parameters. Now
- 12:07Speaker 2: what if the user types letters into a number field
- 12:11Speaker 2: or leave something blank.
- 12:13Speaker 1: Errors happen?
- 12:14Speaker 2: Right? Java MBC uses binding result. You audit as a
- 12:18Speaker 2: parameter to your controller method. It automatically catches conversion errors
- 12:21Speaker 2: or validation failures, and then you can check binding result
- 12:24Speaker 2: for errors. If there are any. You typically add the
- 12:27Speaker 2: air messages to the model's object and return to the
- 12:29Speaker 2: same view showing the user what went wrong.
- 12:32Speaker 1: Nice keeps them on the form.
- 12:33Speaker 2: Exactly and being validation makes this even better. You put
- 12:36Speaker 2: annotations right on your controller method parameters or on your
- 12:39Speaker 2: model bean fields at notinal at size and five at
- 12:42Speaker 2: pattern Reex built in rules loads of them, and you
- 12:45Speaker 2: can create custom ones too. Plus you can easily internationalize
- 12:48Speaker 2: the error messages using validation messages dot properties files, so
- 12:52Speaker 2: error messages appear in the user's language.
- 12:54Speaker 1: Very professional. Okay, what about state you mentioned sessions earlier.
- 12:57Speaker 2: Yeah, persisting state. HTTP is stateless, but web apps aren't.
- 13:02Speaker 2: We need to remember things about a user between requests.
- 13:06Speaker 2: HTTP session is the standard.
- 13:08Speaker 1: Javaway managed by the server YEP.
- 13:10Speaker 2: Usually via cookies behind the scenes. Java MBC makes this
- 13:13Speaker 2: easy with at session scope CDI beans. Just inject your
- 13:16Speaker 2: ad session scope user preferences being and its data sticks
- 13:20Speaker 2: around for that user. Session. Seems convenient, it is, but
- 13:23Speaker 2: big caveat. Don't stuff everything into the session, especially large
- 13:28Speaker 2: objects or lots of data per user. If you have
- 13:31Speaker 2: thousands of users.
- 13:32Speaker 1: Online, memory usage explodes exactly.
- 13:34Speaker 2: It can kill your server's performance and stability. Use session
- 13:37Speaker 2: scope judiciously only for data that truly needs to persist
- 13:40Speaker 2: for the session duration.
- 13:42Speaker 1: Good warning. What about making the UI more dynamic? You
- 13:44Speaker 1: mentioned AJX.
- 13:46Speaker 2: Right AGX asynchronous JavaScript in XML, though nowadays it's off
- 13:49Speaker 2: in JSON not XML. The idea is the browser uses
- 13:53Speaker 2: JavaScript to make background requests to the server without a
- 13:55Speaker 2: full page reload.
- 13:57Speaker 1: Smoother experience, much smoother.
- 14:00Speaker 2: Mber Is like jQuery made this easier, but modern JavaScript
- 14:02Speaker 2: has fetch api built in Your Java mvc controller can
- 14:06Speaker 2: handle these AJAX requests. Instead of returning a full page name,
- 14:10Speaker 2: it might return just an h T Mel fragment or
- 14:12Speaker 2: maybe Jason data.
- 14:13Speaker 1: Okay, so the controller can serve both full pages and
- 14:16Speaker 1: AJX snippets.
- 14:18Speaker 2: Absolutely. The JavaScript on the front end then takes that
- 14:21Speaker 2: response and updates just the relevant part of the page,
- 14:24Speaker 2: maybe updates account, refreshes, a list, shows a status message.
- 14:27Speaker 1: Very cool. You also mentioned observers.
- 14:28Speaker 2: Yeah, CD observers. This is a really elegant way to
- 14:31Speaker 2: handle cross cutting concerns, things like logging, performance monitoring, security checks.
- 14:36Speaker 2: Stuff that needs to happen in response to events, but
- 14:38Speaker 2: isn't core business logic.
- 14:40Speaker 1: How does it work.
- 14:41Speaker 2: You create a method in a cdibing and annotate it
- 14:44Speaker 2: with at observes. You specify the event type you're interested in,
- 14:47Speaker 2: like maybe an event fired just before a controller method
- 14:50Speaker 2: runs bore controller event from javax dobc dot event ah.
- 14:55Speaker 1: So it listens for specific points in the process.
- 14:57Speaker 2: Exactly when that event happens, automatically calls your observer method.
- 15:02Speaker 2: It keeps that logging or monitoring code completely separate from
- 15:06Speaker 2: your controller logic. Really improves maintainability.
- 15:09Speaker 1: That separation of concerns again seems to be a running theme.
- 15:12Speaker 2: It's the theme of good architecture really, which brings us
- 15:15Speaker 2: to bigger enterprise integration like databases.
- 15:18Speaker 1: Right, how does Java MBC talk to a database JPA.
- 15:22Speaker 2: YEP JPA, Java persistence API the standard way in Jakarta EE.
- 15:26Speaker 2: It abstracts away most of the raw sequel uses orim
- 15:30Speaker 2: object relational mapping.
- 15:31Speaker 1: So your Java book object maps to a books table precisely.
- 15:34Speaker 2: You define this mapping using annotations at entity table at
- 15:37Speaker 2: iocolumn right on your Java class and you can figure
- 15:40Speaker 2: the database connection details in a persistence dot XML file.
- 15:43Speaker 1: And how do you actually interact with the data through.
- 15:46Speaker 2: The entity manager. You inject it, and it has methods
- 15:49Speaker 2: like find, persist, merge, remove. It handles translating those calls
- 15:54Speaker 2: into SQL. You'll also need to set up a database
- 15:57Speaker 2: like apatchy Derby and can figure a data source in
- 16:00Speaker 2: glass Fish okay.
- 16:01Speaker 1: So JPA handles the database mapping and interaction. What about
- 16:04Speaker 1: EJBs Enterprise Java beans EJBs.
- 16:07Speaker 2: Are components for business logic. They run in a container
- 16:10Speaker 2: that provides services like transactions, security, concurrency management automatically.
- 16:15Speaker 1: More than just plan Java objects right.
- 16:17Speaker 2: There are different types, mainly session EJBs. Stateless ones are common.
- 16:20Speaker 2: They don't hold client specific state between calls. Good for
- 16:24Speaker 2: service operations like processing a book rental okay. Stateful EJBs
- 16:28Speaker 2: do maintain state across multiple calls from the same client.
- 16:31Speaker 2: Useful for multi step processes like a Wizard or complex
- 16:34Speaker 2: checkout Singleton. EJBs ensure only one instance exists for the
- 16:38Speaker 2: whole application. Good for cases or coordinating tasks.
- 16:41Speaker 1: How does your MBC controller use an EJB?
- 16:44Speaker 2: Usually just inject it Using an EJB, the container handles
- 16:47Speaker 2: providing the instance. EJBs also have cool features like at
- 16:50Speaker 2: asynchronous for background tasks and its schedule for time, jobs.
- 16:54Speaker 1: Powerful stuff and managing all this complexity, Logging must be vital.
- 16:58Speaker 2: Absolutely critical, and enterprise apps for debugging, auditing, just understanding
- 17:02Speaker 2: what's going on. GlassFish uses the standard JSR forty seven
- 17:06Speaker 2: logging API.
- 17:08Speaker 1: By default, where did the logs go?
- 17:10Speaker 2: Typically to server dot log. You have different levels severe warning, info, fine,
- 17:14Speaker 2: finer finance. You configure the level to control how much
- 17:17Speaker 2: detail you get.
- 17:18Speaker 1: Can you use other logging frameworks?
- 17:20Speaker 2: Yes. Log forg is a very popular, powerful alternative. It
- 17:23Speaker 2: separates the logging API from the implementation, can reload its
- 17:27Speaker 2: configuration without restarting the server. Lots of advantages. You can
- 17:30Speaker 2: integrate at server wide or just for your application.
- 17:33Speaker 1: Choosing the right logging level seems important.
- 17:35Speaker 2: It is too little, you can't debug too much. It
- 17:39Speaker 2: impacts performance. You need a strategy. What stands out here
- 17:42Speaker 2: is just how essential good logging is for maintaining complex systems.
- 17:46Speaker 1: Definitely so bringing it all together, this book club example
- 17:50Speaker 1: really uses all these pieces.
- 17:52Speaker 2: Doesn't it. It really does. It uses Derby as the
- 17:54Speaker 2: database configured in glass Fish. It has internationalization for messages,
- 17:59Speaker 2: It uses APA entities for member book rental. It uses
- 18:03Speaker 2: stateless EJBs as data access objects baos to handle the database.
- 18:08Speaker 1: Operations, okay, EJB's for the data logic.
- 18:11Speaker 2: Then it has simple CDI beans acting as the model
- 18:13Speaker 2: for the views. A central Java MVC controller manages all
- 18:17Speaker 2: the web interactions, and the views are jsps using fragments
- 18:20Speaker 2: and some JavaScript for those dynamic updates.
- 18:23Speaker 1: It's quite a good demonstration of how these seemingly separate
- 18:25Speaker 1: technologies MBC, CDI, JPA, EJB all integrate cleanly within the
- 18:30Speaker 1: Jakarta E platform.
- 18:32Speaker 2: Exactly. You see how a complex system gets built from
- 18:34Speaker 2: these well defined modular parts.
- 18:36Speaker 1: Okay, well, that feels like a pretty third journey through
- 18:38Speaker 1: Java Mvc one point zero. We started with the basic
- 18:41Speaker 1: MBC pattern, looked at Java NBC specifics under JSR three
- 18:44Speaker 1: seventy one, touched on its Jakarta E foundations.
- 18:48Speaker 2: Cover the component's model with CDI scopes, view a JSP
- 18:51Speaker 2: and facelooks, caveats, controller handling requests right.
- 18:55Speaker 1: And then validations, state management with sessions, AJAX observers, integrating
- 19:00Speaker 1: with JPA databases and EJBs, and finally logging strategies.
- 19:05Speaker 2: A comprehensive look.
- 19:06Speaker 1: So hopefully you now have a really solid grasp of
- 19:08Speaker 1: how Java NBC works and how you can use it
- 19:11Speaker 1: to build robust, scalable, maintainable applications, web cloud, micro services,
- 19:17Speaker 1: the lot.
- 19:18Speaker 2: And maybe this raises an important question for you, the listener,
- 19:21Speaker 2: to think about as patterns evolve, How does understanding something
- 19:24Speaker 2: foundational like MVC help you adapt?
- 19:27Speaker 1: Hmmm, good question.
- 19:28Speaker 2: Think about how these core ideas, separation of concerns, defined
- 19:31Speaker 2: roles for data logic presentation might show up even in
- 19:35Speaker 2: newer frameworks, maybe just with different names or syntax. How
- 19:39Speaker 2: does this foundation empower you? What stands out to you
- 19:41Speaker 2: about how these architectural patterns really help developers build better software.
- 19:45Speaker 1: That's fantastic thought to leave things on something to definitely
- 19:47Speaker 1: mull over. Thank you so much for joining us on
- 19:49Speaker 1: this deep dive. We hope you found it valuable.