BAEL-4994 extra mvc-mvp module removed
This commit is contained in:
parent
bdec91c268
commit
c5bada9f8b
|
@ -1,24 +0,0 @@
|
|||
package com.baeldung.mvc;
|
||||
|
||||
public class MvcMainClass {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Product model = retrieveProductFromDatabase();
|
||||
ProductView view = new ProductView();
|
||||
model.setProductView(view);
|
||||
model.showProduct();
|
||||
|
||||
ProductController controller = new ProductController(model);
|
||||
controller.setProductName("SmartPhone");
|
||||
model.showProduct();
|
||||
}
|
||||
|
||||
private static Product retrieveProductFromDatabase() {
|
||||
Product product = new Product();
|
||||
product.setProductName("Mobile");
|
||||
product.setProductDescription("New Brand");
|
||||
product.setProductPrice(1000.0);
|
||||
return product;
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package com.baeldung.mvc;
|
||||
|
||||
public class Product {
|
||||
private String productName;
|
||||
private String productDescription;
|
||||
private Double productPrice;
|
||||
private ProductView productView;
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductDescription() {
|
||||
return productDescription;
|
||||
}
|
||||
|
||||
public void setProductDescription(String productDescription) {
|
||||
this.productDescription = productDescription;
|
||||
}
|
||||
|
||||
public Double getProductPrice() {
|
||||
return productPrice;
|
||||
}
|
||||
|
||||
public void setProductPrice(Double productPrice) {
|
||||
this.productPrice = productPrice;
|
||||
}
|
||||
|
||||
public ProductView getProductView() {
|
||||
return productView;
|
||||
}
|
||||
|
||||
public void setProductView(ProductView productView) {
|
||||
this.productView = productView;
|
||||
}
|
||||
|
||||
public void showProduct() {
|
||||
productView.printProductDetails(productName, productDescription, productPrice);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package com.baeldung.mvc;
|
||||
|
||||
public class ProductController {
|
||||
private final Product product;
|
||||
|
||||
public ProductController(Product product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return product.getProductName();
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
product.setProductName(productName);
|
||||
}
|
||||
|
||||
public String getProductDescription() {
|
||||
return product.getProductDescription();
|
||||
}
|
||||
|
||||
public void setProductDescription(String productDescription) {
|
||||
product.setProductDescription(productDescription);
|
||||
}
|
||||
|
||||
public Double getProductPrice() {
|
||||
return product.getProductPrice();
|
||||
}
|
||||
|
||||
public void setProductPrice(Double productPrice) {
|
||||
product.setProductPrice(productPrice);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.baeldung.mvc;
|
||||
|
||||
public class ProductView {
|
||||
public void printProductDetails(String productName, String productDescription, Double productPrice) {
|
||||
System.out.println("Product details:");
|
||||
System.out.println("product Name: " + productName);
|
||||
System.out.println("product Description: " + productDescription);
|
||||
System.out.println("product price: " + productPrice);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.baeldung.mvp;
|
||||
|
||||
public class MvpMainClass {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Product model = retrieveProductFromDatabase();
|
||||
ProductView view = new ProductView();
|
||||
ProductPresenter presenter = new ProductPresenter(model, view);
|
||||
presenter.showProduct();
|
||||
presenter.setProductName("SmartPhone");
|
||||
presenter.showProduct();
|
||||
}
|
||||
|
||||
private static Product retrieveProductFromDatabase() {
|
||||
Product product = new Product();
|
||||
product.setProductName("Mobile");
|
||||
product.setProductDescription("New Brand");
|
||||
product.setProductPrice(1000.0);
|
||||
return product;
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.baeldung.mvp;
|
||||
|
||||
public class Product {
|
||||
private String productName;
|
||||
private String productDescription;
|
||||
private Double productPrice;
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductDescription() {
|
||||
return productDescription;
|
||||
}
|
||||
|
||||
public void setProductDescription(String productDescription) {
|
||||
this.productDescription = productDescription;
|
||||
}
|
||||
|
||||
public Double getProductPrice() {
|
||||
return productPrice;
|
||||
}
|
||||
|
||||
public void setProductPrice(Double productPrice) {
|
||||
this.productPrice = productPrice;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package com.baeldung.mvp;
|
||||
|
||||
public class ProductPresenter {
|
||||
private final Product product;
|
||||
private final ProductView productView;
|
||||
|
||||
public ProductPresenter(Product product, ProductView productView) {
|
||||
this.product = product;
|
||||
this.productView = productView;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return product.getProductName();
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
product.setProductName(productName);
|
||||
}
|
||||
|
||||
public String getProductDescription() {
|
||||
return product.getProductDescription();
|
||||
}
|
||||
|
||||
public void setProductDescription(String productDescription) {
|
||||
product.setProductDescription(productDescription);
|
||||
}
|
||||
|
||||
public Double getProductPrice() {
|
||||
return product.getProductPrice();
|
||||
}
|
||||
|
||||
public void setProductPrice(Double productPrice) {
|
||||
product.setProductPrice(productPrice);
|
||||
}
|
||||
|
||||
public void showProduct() {
|
||||
productView.printProductDetails(product.getProductName(), product.getProductDescription(), product.getProductPrice());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.baeldung.mvp;
|
||||
|
||||
public class ProductView {
|
||||
public void printProductDetails(String productName, String productDescription, Double productPrice) {
|
||||
System.out.println("Product details:");
|
||||
System.out.println("product Name: " + productName);
|
||||
System.out.println("product Description: " + productDescription);
|
||||
System.out.println("product price: " + productPrice);
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue