|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/java-exercises-simple-intermediate-complex/
课程评论:没有评论
Coursera 课程“100+ Java Exercises”旨在全面提升您的 Java 编程能力,从基础到专家级,帮助您设计高效、可扩展且易于维护的软件。 **课程核心内容包括:** * **Java 核心概念与面向对象编程 (OOP):** 深入理解类、对象、构造器、方法重载与重写、继承、多态、封装、抽象类和接口,以及泛型(包括有界类型参数和泛型数据结构实现)。 * **集合框架:** 熟练运用 `HashMap`、`LinkedHashMap`、`ConcurrentHashMap`、`Queue`、`List` 等,并掌握线程安全集合的使用。 * **异常处理:** 覆盖检查异常和非检查异常(如 `IOException`、`InterruptedException`、`RuntimeException`),以及 `try-catch-finally` 块和自定义异常。 * **并发与多线程:** * **线程安全:** 学习使用 `synchronized` 块和方法,以及 `AtomicReference`、`ConcurrentHashMap` 等线程安全集合。 * **高级并发机制:** 探索非阻塞算法(如 CAS 实现的 `LockFreeStack`)、阻塞队列(`wait`/`notifyAll`)、`Executor` 框架(`ExecutorService`、`ScheduledExecutorService`、线程池)及其任务调度,以及 `volatile` 关键字与原子性操作(`AtomicInteger`、`compareAndSet`)。 * **双重检查锁定 (Double-Checked Locking):** 实现高效的线程安全单例模式。 * **数据结构与算法:** * **自定义数据结构:** 实现 LRU 缓存、CAS 实现的无锁栈、线程安全有界阻塞队列。 * **算法模式:** 编写 LRU 缓存淘汰算法,设计内存高效、高性能的 ID 生成器(受 Snowflake 启发)。 * **高级设计模式:** * **单例模式:** 实现线程安全的懒汉式单例(含双重检查锁定)。 * **发布-订阅 (Pub/Sub):** 构建基于主题和订阅者的消息系统。 * **依赖注入 (DI):** 设计轻量级 DI 容器实现自动依赖解析。 * **事件驱动架构:** 构建自定义事件循环,实现异步任务执行。 * **分布式系统:** * **分布式 ID 生成器:** 创建按时间顺序排列的唯一 ID (结合时间戳、机器 ID 和序列号)。 * **容错机制:** 实现断路器模式,优雅处理服务故障。 * **性能优化:** * **延迟初始化:** 优化资源创建,推迟到需要时再初始化。 * **非阻塞同步:** 利用 CAS 实现高性能无锁数据结构。 * **速率限制:** 通过令牌桶算法控制 API 请求频率。 * **I/O 与序列化:** * **自定义序列化框架:** 使用反射实现对象的序列化和反序列化。 * **文件处理:** 通过多线程分块高效处理大型文件。 * **测试与调试:** * **单元测试:** 使用 JUnit 5 编写测试用例,验证实现正确性和线程安全。 * **错误处理:** 学习优雅处理系统错误,防止级联故障。 * **实际应用:** * **可扩展缓存:** 为高性能应用设计 LRU 缓存。 * **分布式系统:** 为大规模分布式应用构建唯一 ID 生成器和微服务断路器。 * **任务调度:** 实现周期性和延迟任务的调度器。 * **消息系统:** 通过发布-订阅模式实现解耦通信。 **通过本课程,您将掌握以下关键技能:** * 设计和实现线程安全的系统。 * 理解并应用高级同步技术。 * 构建可扩展、容错且高性能的解决方案。 * 应用业界主流设计模式和最佳实践。
This course takes you on a journey from foundational Java programming to expert-level skills, equipping you to design efficient, scalable, and maintainable software. Through hands-on exercises, real-world scenarios, and best practices, you'll gain practical expertise in:Java Core ConceptsObject-Oriented Programming (OOP)Classes, objects, and constructors.Method overriding and overloading.Inheritance, polymorphism, and encapsulation.Abstract classes and interfaces.GenericsImplementing generic data structures (e.g., LockFreeStack).Using bounded type parameters.Collections FrameworkUsing HashMap, LinkedHashMap, ConcurrentHashMap, Queue, and List.Working with thread-safe collections.Exception HandlingHandling checked and unchecked exceptions (IOException, InterruptedException, RuntimeException).Using try-catch-finally and custom exception messages.Concurrency and MultithreadingThread SafetySynchronization with synchronized blocks and methods.Thread-safe data structures like AtomicReference and ConcurrentHashMap.Advanced Concurrency MechanismsNon-blocking algorithms (e.g., LockFreeStack with Compare-And-Swap).Blocking queues with wait() and notifyAll().Executor FrameworkUsing ExecutorService, ScheduledExecutorService, and thread pools.Task scheduling with fixed-rate and fixed-delay jobs.Volatile and Atomicityvolatile for visibility across threads.Atomic operations with AtomicInteger and compareAndSet.Double-Checked LockingImplementing thread-safe singletons with minimal synchronization overhead.Data Structures and AlgorithmsCustom Data StructuresLRU Cache using LinkedHashMap.Lock-free stack with CAS.Thread-safe bounded blocking queues.Algorithmic PatternsImplementing Least Recently Used (LRU) cache eviction.Designing memory-efficient and high-performance ID generators (Snowflake-inspired).Advanced Design PatternsSingletonThread-safe Singleton with lazy initialization and double-checked locking.Publish-Subscribe (Pub/Sub)Implementing a messaging system with topics and subscribers.Dependency Injection (DI)Lightweight DI container for automatic dependency resolution.Event-Driven ArchitecturesCustom event loops for asynchronous task execution.Distributed SystemsDistributed ID GeneratorsTime-ordered unique IDs using timestamp, machine ID, and sequence numbers.Fault ToleranceImplementing Circuit Breaker patterns to handle service failures gracefully.Performance OptimizationLazy InitializationOptimizing resource creation to defer initialization until necessary.Non-Blocking SynchronizationUsing CAS for high-performance, lock-free data structures.Rate LimitingToken Bucket algorithm for throttling API requests.I/O and SerializationCustom Serialization FrameworkUsing reflection for object serialization and deserialization.File ProcessingMulti-threaded processing of large files with efficient chunking.Testing and DebuggingUnit TestingWriting JUnit 5 tests for validating implementation correctness.Testing thread safety and concurrency.Error HandlingGracefully managing system errors and preventing cascading failures.Real-World ApplicationsScalable CachesDesigning LRU caches for performance-critical applications.Distributed SystemsUnique ID generators for large-scale distributed applications.Circuit breakers for microservices.Task SchedulingImplementing schedulers for periodic and delayed tasks.Messaging SystemsPublish-Subscribe patterns for decoupled communication.Key Skills PracticedDesigning and implementing thread-safe systems.Understanding and applying advanced synchronization techniques.Building scalable, fault-tolerant, and performant solutions.Applying real-world design patterns and best practices.